Skip to content
Permalink
Browse files

Add Task sheduler

  • Loading branch information...
Insax committed Apr 28, 2017
1 parent 83efd55 commit 2adf311030a9ea66cd661aa7e296819ea9c81600
Showing with 10 additions and 2 deletions.
  1. +10 −2 app/Console/Kernel.php
@@ -4,6 +4,8 @@
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
class Kernel extends ConsoleKernel
{
@@ -24,8 +26,14 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
$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();
}
})->daily();
}
/**

0 comments on commit 2adf311

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