Commit 7463c884 authored by ZeMKI's avatar ZeMKI

Bugfix scheduled command

* now the command has no "daily" because this is set in the crontab in ubuntu.
* now pruneurls deleted links older than 14 days.
parent 160350ce
......@@ -40,7 +40,7 @@ class PruneInterviewPublicUrl extends Command
*/
public function handle()
{
$urls = PublicInterviewUrl::where('created_at', '<=', Carbon::now()->subDays(2))->whereNull('submitted_at')->get();
$urls = PublicInterviewUrl::where('created_at', '<=', Carbon::now()->subDays(14))->whereNull('submitted_at')->get();
$countUrls = $urls->count();
foreach($urls as $url)
......
......@@ -27,8 +27,8 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('telescope:prune --hours=48')->daily();
$schedule->command('pruneurls')->daily()->emailOutputTo('belli@uni-bremen.de');
$schedule->command('telescope:prune --hours=336');
$schedule->command('pruneurls')->emailOutputTo('belli@uni-bremen.de');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment