Skip to content
Permalink
Browse files

Add Check to Task Sheduler

  • Loading branch information...
Insax committed May 31, 2017
1 parent a4ab68e commit fb418fc0298a8da58cc31ccc50286ed52bd238d1
Showing with 8 additions and 4 deletions.
  1. +8 −4 app/Console/Kernel.php
@@ -28,10 +28,14 @@ protected function schedule(Schedule $schedule)
{
$schedule->call(function() {
$data = DB::table('data')->where('created_at', '<', '(NOW() - INTERVAL 1 DAY)')->value('guid');
foreach ($data as $e) {
Storage::delete($e);
Storage::delete('public/'.$e.'.mp4');
DB::table('data')->where('guid', '=', $e)->delete();
if($data)
{
foreach ($data as $e) {
Storage::delete($e);
Storage::delete('public/'.$e.'.mp4');
DB::table('data')->where('guid', '=', $e)->delete();
}
}
})->daily();
}

0 comments on commit fb418fc

Please sign in to comment.
You can’t perform that action at this time.