Refactor cleanup:database command signature to include optional --keep-days parameter
This commit is contained in:
parent
369e99a2c9
commit
5967d70713
1 changed files with 3 additions and 3 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
class CleanupDatabase extends Command
|
class CleanupDatabase extends Command
|
||||||
{
|
{
|
||||||
protected $signature = 'cleanup:database {--yes}';
|
protected $signature = 'cleanup:database {--yes} {--keep-days=}';
|
||||||
|
|
||||||
protected $description = 'Cleanup database';
|
protected $description = 'Cleanup database';
|
||||||
|
|
||||||
|
|
@ -20,9 +20,9 @@ public function handle()
|
||||||
}
|
}
|
||||||
if (isCloud()) {
|
if (isCloud()) {
|
||||||
// Later on we can increase this to 180 days or dynamically set
|
// Later on we can increase this to 180 days or dynamically set
|
||||||
$keep_days = 60;
|
$keep_days = $this->option('keep-days') ?? 60;
|
||||||
} else {
|
} else {
|
||||||
$keep_days = 60;
|
$keep_days = $this->option('keep-days') ?? 60;
|
||||||
}
|
}
|
||||||
echo "Keep days: $keep_days\n";
|
echo "Keep days: $keep_days\n";
|
||||||
// Cleanup failed jobs table
|
// Cleanup failed jobs table
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue