Hi guys! I have a question about task options; can...
# ask-community
m
Hi guys! I have a question about task options; can I combine the
retries
option with the
timeout
? Let me explain better: Inside my task I am polling an API waiting for something to finish. If one of those HTTP calls fail, I'd like to retry, but if it takes too long and that something hasn't finished, I want the entire task to timeout. Is that how combining those two options work? I'm afraid that a timeout would cause a retry and start all over again.
k
Hey Matias, Yes, a timed out task will trigger a retry. The task will wait the indicated time (in seconds) while running a task before the timeout occurs. Alternatively, an advanced technique would be to create a custom timeout handler by importing
timeout_handler
from
prefect.utilities.executors
.
m
Oh, that is nice! Thanks a lot for your answer :)
c
@Marvin archive “Using Retries and Timeouts together”