Permalink
Browse files

Schedule periodic synchronizations

  • Loading branch information...
lorisleiva committed Sep 17, 2018
1 parent 35ea0da commit d06b8a88c91c61b813c61951040734ce7e250045
Showing with 22 additions and 2 deletions.
  1. +2 −2 app/Console/Kernel.php
  2. +20 −0 app/Jobs/PeriodicSynchronizations.php
View
@@ -2,6 +2,7 @@
namespace App\Console;
use App\Jobs\PeriodicSynchronizations;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@@ -24,8 +25,7 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
$schedule->job(new PeriodicSynchronizations())->everyFifteenMinutes();
}
/**
@@ -0,0 +1,20 @@
<?php
namespace App\Jobs;
use App\Synchronization;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class PeriodicSynchronizations implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Synchronization::get()->each->ping();
}
}

0 comments on commit d06b8a8

Please sign in to comment.