Skip to content
Snippets Groups Projects
Commit e328a7e3 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

The old humanverification entries now get deleted by the laravel scheduler

parent cc9d0051
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
......@@ -2,6 +2,7 @@
namespace App\Console;
use DB;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
......@@ -25,6 +26,12 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule)
{
$schedule->command('log:rotate')->everyTenMinutes();
// Delete all of the old humanverification entries
$schedule->call(function() {
DB::delete('DELETE FROM humanverification WHERE updated_at < (now() - interval 72 hour) AND whitelist = 0 ORDER BY updated_at DESC');
DB::delete('DELETE FROM humanverification WHERE updated_at < (now() - interval 2 week) AND whitelist = 1 ORDER BY updated_at DESC');
})->everyThirtyMinutes();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment