Last active
December 8, 2017 20:32
-
-
Save alexgarrettsmith/0c2d91a26558e3e08af31d45ddf1a9e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Codecourse\App\Console\Commands; | |
use Illuminate\Console\Command; | |
class SchedulerDaemon extends Command | |
{ | |
/** | |
* The name and signature of the console command. | |
* | |
* @var string | |
*/ | |
protected $signature = 'schedule:daemon {--timeout=60}'; | |
/** | |
* The console command description. | |
* | |
* @var string | |
*/ | |
protected $description = 'Call the scheduler every minute.'; | |
/** | |
* Execute the console command. | |
* | |
* @return mixed | |
*/ | |
public function handle() | |
{ | |
while (true) { | |
$this->call('schedule:run'); | |
sleep($this->option('timeout')); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment