Tasks automatically timeout after 20 minutes if they haven’t started running. This default exists to prevent stuck tasks from consuming compute resources and potentially blocking other tasks in the queue.
You can specify your own timeouts. Timeouts can be used for endpoints, task queues, and functions:
timeout.py
Copy
Ask AI
from beam import functionimport time@function(timeout=600) # Override default timeoutdef timeout(): import time # Without the timeout specified above, this function would timeout at 300s time.sleep(350)if __name__ == "__main__": timeout()