Task hot disabling and other capabilities
Closed this issue · 2 comments
scion4581 commented
Hello! Thanks for sharing this bundle, hope I find it useful in my projects
But for now, I have some questions that haunt me.
- What I need to do in case I want to disable a certain task immediately? Change source code and redeploy app?
- Is there a way to find out that some task is running right now?
For example, while deploying I could use this information and wait until the task will be finished, and only then update the app - Does task lock have some timeout? After that, it will be automatically released, cause some infinitive loop or network problems could lock that task forever
- Is there a way to get a list of all tasks not from CLI but show in admin area at least for information purposes
Thanks once again
kbond commented
Hey!
- No way out of the box, redeploying is the only way. You could rig something custom up with either events or a custom extension that skips the task under certain conditions.
- No, again you'd have to create something custom. In my app, I detect if the the app is deploying and skip running the schedule if it is. This only stops new tasks from starting however.
- You can pass a TTL to
$task->withoutOverlapping()/onSingleServer()
. I'm not really familiar withsymfony/lock
but I believe the lock auto-expires if it's not released after that time. - Again, not out of the box but I created a full admin interface for my schedule pretty easily: create a controller and inject
ScheduleRunner
, then call$scheduleRunner->buildSchedule()->all()
to get all the availableTask
objects.
Hope this helps!
scion4581 commented
Thank you very much, I'll give it a try!