mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Add S3 clean up on hosted
This commit is contained in:
parent
1fb6030bc8
commit
4d35ed3ce5
@ -20,7 +20,7 @@ class S3Cleanup extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Remove orphan folders';
|
||||
protected $description = 'Remove orphan folders/files';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@ -54,7 +54,11 @@ class S3Cleanup extends Command
|
||||
if(!in_array($dir, $merged))
|
||||
{
|
||||
$this->logMessage("Deleting $dir");
|
||||
Storage::disk(config('filesystems.default'))->deleteDirectory($dir);
|
||||
|
||||
/* Ensure we are not deleting the root folder */
|
||||
if(strlen($dir) > 1)
|
||||
Storage::disk(config('filesystems.default'))->deleteDirectory($dir);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,8 @@ class Kernel extends ConsoleKernel
|
||||
|
||||
$schedule->job(new AdjustEmailQuota)->dailyAt('23:00')->withoutOverlapping();
|
||||
$schedule->job(new SendFailedEmails)->daily()->withoutOverlapping();
|
||||
$schedule->command('ninja:check-data --database=db-ninja-02')->daily()->withoutOverlapping();
|
||||
$schedule->command('ninja:check-data --database=db-ninja-02')->dailyAt('00:15')->withoutOverlapping();
|
||||
$schedule->command('ninja:s3-cleanup')->dailyAt('23:15')->withoutOverlapping();
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user