mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Improve system maintenance task
This commit is contained in:
parent
accd408ba1
commit
66f3a4fc14
@ -57,7 +57,6 @@ class Kernel extends ConsoleKernel
|
||||
|
||||
$schedule->job(new ReminderJob)->hourly()->withoutOverlapping();
|
||||
|
||||
// $schedule->job(new LedgerBalanceUpdate)->everyFiveMinutes()->withoutOverlapping();
|
||||
$schedule->job(new QueueSize)->everyFiveMinutes()->withoutOverlapping();
|
||||
|
||||
$schedule->job(new CompanySizeCheck)->daily()->withoutOverlapping();
|
||||
|
@ -122,7 +122,7 @@ class SystemMaintenance implements ShouldQueue
|
||||
nlog("deleting {$backup->filename}");
|
||||
|
||||
if($backup->filename)
|
||||
Storage::disk(config('filesystems.default'))->delete($backup->filename);
|
||||
$backup->deleteFile();
|
||||
|
||||
$backup->delete();
|
||||
|
||||
|
@ -47,4 +47,22 @@ class Backup extends BaseModel
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function deleteFile()
|
||||
{
|
||||
|
||||
nlog("deleting => ". $this->filename);
|
||||
|
||||
try{
|
||||
|
||||
Storage::disk(config('filesystems.default'))->delete($this->filename);
|
||||
|
||||
}
|
||||
catch(\Exception $e){
|
||||
|
||||
nlog("BACKUPEXCEPTION deleting backup file with error ". $e->getMessage());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user