diff --git a/app/Console/Commands/FailedJobGC.php b/app/Console/Commands/FailedJobGC.php new file mode 100644 index 00000000..f48d49b8 --- /dev/null +++ b/app/Console/Commands/FailedJobGC.php @@ -0,0 +1,49 @@ +failed_at->lt(now()->subMonth())) { + $job->delete(); + } + } + }); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 1e3364af..046890e7 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -31,6 +31,7 @@ class Kernel extends ConsoleKernel ->hourly(); $schedule->command('horizon:snapshot')->everyFiveMinutes(); $schedule->command('story:gc')->everyFiveMinutes(); + $schedule->command('gc:failedjobs')->daily(); } /**