Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requeue Takes the inital delay as original call #398

Open
chiragkatare opened this issue Jan 10, 2025 · 1 comment
Open

Requeue Takes the inital delay as original call #398

chiragkatare opened this issue Jan 10, 2025 · 1 comment

Comments

@chiragkatare
Copy link

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.

@s3rius
Copy link
Member

s3rius commented Jan 28, 2025

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants