taskiq
taskiq copied to clipboard
Requeue Takes the inital delay as original call
I am using rabbitmq with taskiq, My use case is to delay a job and inside the task worker i am using context to requeue the job ,
There its again delaying the job for the original delay.
I'm not 100 sure what is the problem, but if the problem is that the requeued task was sent with the same delay as the original, then most probably it's because the desired delay is stored in labels. You can delete the delay label before requeue to avoid delayed execution for the second time. Like this:
@broker.task
async def example(context: Context):
context.message.labels.pop("delay")
await context.requeue()