I am trying to get my website to send confirmations emails every time someone new register.
i did it like following after reading about it, but i am still not convinced that this is the best way to do it.
in my cron runs every minute and calls php artisan schedule:run
in my console/Kernel
protected function schedule(Schedule $schedule)
{
$schedule->command('queue:work --once')->everyMinute()->withoutOverlapping();
}
i added the --once parameter because the queue worker is not existing when finished, and i do not want to have many new processes running every minute.
is there a way to make the queue worker finish all the jobs and exit and then start it after one minute again so that i do not have many instances , or is it just one instance ??
i read that i can return null to exit the worker, but if this can be done, then how can i return null only after the last job is done?