dimanche 23 octobre 2016

Laravel - Run scheduled task only if same previous task has finished

I was wondering if Laravel has a built in function to only run a scheduled task if the previous has finished.

I have a need to run a specific task every few seconds, but the task relies on querying another host that may at some point lose connection.

There are a couple of ways I thought about doing this, if there isn't:

  1. Having the task just put the job into the queue
  2. Having a flag saved (Either as a file or in the db), that is set at the start of the task, and unset at the finish.

Just hoping the task scheduler has something built in before I go down either of those routes ...



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire