long-sleep-not-forever (ASYNC116)
Added in 0.13.0 · Related issues · View source
Derived from the flake8-async linter.
Fix is sometimes available.
What it does
Checks for uses of trio.sleep() or anyio.sleep() with a delay greater than 24 hours.
Why is this bad?
Calling sleep() with a delay greater than 24 hours is usually intended
to sleep indefinitely. Instead of using a large delay,
trio.sleep_forever() or anyio.sleep_forever() better conveys the intent.
Example
Use instead:
Fix safety
This fix is marked as unsafe as it changes program behavior.