delightful-queen-21464
10/04/2024, 9:23 PMhigh-park-82026
import signal
import time
def handler(signum, frame):
raise TimeoutError("Timeout reached")
@task
def my_task():
# Set the signal handler
signal.signal(signal.SIGALRM, handler)
signal.alarm(10) # Set the timeout to 10 seconds
# Your long-running code here
I've not tried this but looks plausiblefreezing-airport-6809
freezing-airport-6809
delightful-queen-21464
10/05/2024, 3:03 AMdelightful-queen-21464
10/05/2024, 3:03 AMMaybe we want a task timeout and a deadlinewhat makes you suggest this? 🤔
freezing-airport-6809