Closed Miksus closed 1 year ago
like this?
from functools import partial
async def do_things(arg):
print("Doing", arg)
time.sleep(2)
print("Did", arg)
t1 = app.task("every 10 seconds", name="t1")(partial(do_things, arg=1))
t2 = app.task("every 15 seconds", name="t2")(partial(do_things, arg=2))
logger.info(f'{t1=}')
logger.info(f'{t2=}')
app.run()
Is your feature request related to a problem? Please describe. Currently, a task can run only once at a time. It does not support launching the same task simultaneously.
Describe the solution you'd like Something like this:
If it was called like this:
This should print:
Currently, Rocketry checks whether the task is already running before running it. And it will block second run if it was running.
Describe alternatives you've considered Create duplicate tasks with different names.
Additional context By default this should be not permitted as the logs may become a mess.