I'm trying to make scheduled task for every 5 seconds.
This is my code.
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
$schedule->call('App\Http\Controllers\SoapController@show')->cron('0,5 * * * *');
}
/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
require base_path('routes/console.php');
}
And I'm getting this error when I enter
php artisan schedule:run
command.
No scheduled commands are ready to run.
Edit:
I Updated my scheduler and command section. I created a command.
And when I use it like
php artisan get:data
its working.
But when I try it with scheduler its just working for 1 time.
protected $commands = [
\App\Console\Commands\GetData::class,
];
$schedule->command('get:data')->cron('* * * * *');