Arthur
02/05/2025, 4:36 PMMarvin
02/05/2025, 4:37 PMtimeout
parameter when defining your task. Here's a basic example:
python
from prefect import task, flow
@task(timeout_seconds=7200) # Increase timeout to 7200 seconds (2 hours)
def my_task():
# Your task logic here
pass
@flow
def my_flow():
my_task()
my_flow()
You can adjust the timeout_seconds
to a value that suits your needs. If you're working with an older version or a different setup, ensure you're using the correct syntax by checking the Prefect documentation.
For more information, you might want to explore the task engine source code where the TaskRunTimeoutError
is defined.Arthur
02/05/2025, 4:39 PMMarvin
02/05/2025, 4:39 PMtimeout_seconds
keyword argument when defining a flow in code.
For more detailed configuration options, you might want to explore the Prefect settings reference. This page includes various settings that can be adjusted, though it doesn't specifically mention setting a global default timeout for flows via the UI.
If you're looking for a more centralized configuration, consider setting timeouts programmatically in your flow definitions or using environment variables where applicable.