I tried to set the timeout before I run the task, ...
# prefect-community
r
I tried to set the timeout before I run the task, for example flow.slow_task.timeout = 100 for @task(timeout=9) def slow_task(opts, scripts): sleep(10) return 1
j
Hi Rob, timeouts for a task are currently statically set on the task at flow registration time (as
task.timeout
). If no timeout is set on a task at registration time, the default configured timeout is used (if any). There is not currently a way to configure a timeout at runtime, using a parameter or otherwise.
(Also, hygiene note - in the future can you use slack threads for multiple comments in a question, rather than posting multiple top level comments? This makes it easier to track conversations, as they all happen in their own thread).
r
That's a shame. I thought I was missing something. Wasn't. I guess I'll have to subclass task to make one that I can edit the timeout. It would be interesting to add a timeout based on a tag.