Laravel run multiple scheduled tasks

≯℡__Kan透↙ 提交于 2019-12-01 03:16:06
  1. Better to use queue for job processing
  2. on cron, add all jobs to queue
  3. Run multiple queue workers, which will process jobs in parallel

Tip: It happened with us. It might happen that job added previously is not complete, yet cron adds the same task in queue again. As queues works sequentially. To save yourself from the situation, you should in database mark when a task is completed last time, so you know when to execute the job (if it was seriously delayed)

I found this on the documentation, I hope this is what you're looking for:

  • Retrieving Input

While your command is executing, you will obviously need to access the values for the arguments and options accepted by your application. To do so, you may use the argument and option methods:

  • Retrieving The Value Of A Command Argument

$value = $this->argument('name');

  • Retrieving All Arguments

$arguments = $this->argument();

  • Retrieving The Value Of A Command Option

$value = $this->option('name');

  • Retrieving All Options

$options = $this->option();

source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!