cloud: run cleanup every day
This commit is contained in:
parent
dcaa2f4168
commit
a8417aca16
@ -20,7 +20,7 @@ class CleanupDatabase extends Command
|
|||||||
$keep_days = 60;
|
$keep_days = 60;
|
||||||
echo "Keep days: $keep_days\n";
|
echo "Keep days: $keep_days\n";
|
||||||
// Cleanup failed jobs table
|
// Cleanup failed jobs table
|
||||||
$failed_jobs = DB::table('failed_jobs')->where('failed_at', '<', now()->subDays(7));
|
$failed_jobs = DB::table('failed_jobs')->where('failed_at', '<', now()->subDays(1));
|
||||||
$count = $failed_jobs->count();
|
$count = $failed_jobs->count();
|
||||||
echo "Delete $count entries from failed_jobs.\n";
|
echo "Delete $count entries from failed_jobs.\n";
|
||||||
if ($this->option('yes')) {
|
if ($this->option('yes')) {
|
||||||
|
@ -48,9 +48,7 @@ class Kernel extends ConsoleKernel
|
|||||||
$this->pull_helper_image($schedule);
|
$this->pull_helper_image($schedule);
|
||||||
$this->check_scheduled_tasks($schedule);
|
$this->check_scheduled_tasks($schedule);
|
||||||
|
|
||||||
if (!isCloud()) {
|
$schedule->command('cleanup:database --yes')->daily();
|
||||||
$schedule->command('cleanup:database --yes')->daily();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private function pull_helper_image($schedule)
|
private function pull_helper_image($schedule)
|
||||||
|
@ -7,7 +7,7 @@ return [
|
|||||||
|
|
||||||
// The release version of your application
|
// The release version of your application
|
||||||
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
||||||
'release' => '4.0.0-beta.244',
|
'release' => '4.0.0-beta.245',
|
||||||
// When left empty or `null` the Laravel environment will be used
|
// When left empty or `null` the Laravel environment will be used
|
||||||
'environment' => config('app.env'),
|
'environment' => config('app.env'),
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return '4.0.0-beta.244';
|
return '4.0.0-beta.245';
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"version": "3.12.36"
|
"version": "3.12.36"
|
||||||
},
|
},
|
||||||
"v4": {
|
"v4": {
|
||||||
"version": "4.0.0-beta.244"
|
"version": "4.0.0-beta.245"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user