|
|
|
|
|
by Miksus
1369 days ago
|
|
Do you mean with "dynamically schedule and unschedule" that you sort of manually (or using another task) stop running a task in its specified interval (or condition)? It does support this, there is an argument "disabled" in the tasks that can be set True and then the task won't be run unless explicitly forced to run (calling run method of a task). The task can be enabled by setting it back to False. This can be done in runtime in another task using main, thread or async execution. It could be the docs don't mention this. I'll need to check and add it there in case it's missing. Or did I misunderstand? |
|
This way you can load and unload tasks at runtime based on user input which you can optionally and independently save in your own database.
Like imagine a user wanting to control when a backup happens. You can ask them to fill out a form on your site to say "ok run this every day at 4am" and that would spawn a new job that executes at that interval and the user can also delete that and the job would be removed. There might be 100 different users each with their own individual backup jobs that are running or not running.