Hi Prefect team I am trying to handle tasks timout...
# ask-community
n
Hi Prefect team I am trying to handle tasks timout, and was wondering how can I stop/cancel a task if the timout is reached FYI: I am using Prefect 2.3.1 Here is an exemple of what I want to do
Copy code
Wait N sconds for the task to complete

        >>> @flow
        >>> def my_flow():
        >>>     future = my_task()
        >>>     final_state = future.wait(0.1)
        >>>     if final_state:
        >>>         ... # Task done
        >>>     else:
        >>>         ... # Task not done yet = > Cancel task
1
c
H Naila, Is this what you are looking for? https://docs.prefect.io/concepts/tasks/#timeouts
n
Hi Christopher yes i'm looking for this , but in the version that i'm using (2.3.1) the
timeout_seconds
argument doesn't exist, which version is this please ?
c
For bug fixes and stability, we generally recommend the latest (which is 2.7.5), unless you have a reason to use a specific older version
n
okay , i'll give it a try, thank you 🙂