Task timeouts #9
RealOrangeOne
started this conversation in
Ideas
Replies: 2 comments 8 replies
-
This can solve #46 of course... |
Beta Was this translation helpful? Give feedback.
4 replies
-
Consider this code: import time
from django_tasks.task import task
@task()
def highlander_1986():
while True:
try:
time.sleep(100)
except BaseException:
pass
AFAIK, the only reliable way to kill a runaway task is to first run it in a subprocess. Forking a subprocess for each task would be costly, but that might not be necessary; after a successful task, the subprocess can be reused. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
One of the reasons to move a task to the background is to prevent it slowing down page requests. However, tasks shouldn't be allowed to run forever, and so should have a timeout.
How will timeouts interact with timeouts and retries (#6)?
Beta Was this translation helpful? Give feedback.
All reactions