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

asynq/tools: update aretry to compatible with asynq_to_asyncio #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SoulTch
Copy link
Contributor

@SoulTch SoulTch commented Dec 12, 2024

Retry blocks the event loop when it retries for exceptions. Fix this by using asyncio.sleep.

async def _asyncio_sleep(secs: float) -> None:
await asyncio.sleep(secs)

@asynq(asyncio_fn=_asyncio_sleep)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@asynq(asyncio_fn=_asyncio_sleep)
@asynq(asyncio_fn=asyncio.sleep)

I don't think you need the wrapper function?

@JelleZijlstra
Copy link
Contributor

You also need to run black on tools.py to fix CI.

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

Successfully merging this pull request may close these issues.

2 participants