Channels
pacc-may-31-2023
prefect-ai
pacc-clearcover-june-12-2023
marvin-in-the-wild
data-ecosystem
geo-israel
pacc-june-14-2023
geo-japan
prefect-cloud
ppcc-may-16-2023
prefect-azure
prefect-docker
prefect-recipes
gratitude
geo-nyc
geo-bay-area
geo-boston
geo-london
geo-dc
geo-chicago
geo-berlin
geo-texas
geo-seattle
geo-colorado
prefect-community
data-tricks-and-tips
prefect-aws
prefect-gcp
introductions
find-a-prefect-job
prefect-dbt
random
events
ask-marvin
show-us-what-you-got
prefect-getting-started
prefect-integrations
prefect-contributors
best-practices-coordination-plane
announcements
prefect-server
prefect-ui
prefect-kubernetes
Powered by
Title
m
Marc Lipoff
03/17/2022, 6:11 PM
What's the best way to retry a task, only in certain scenarios? For example, I'm pulling from an API. I only want to retry (after 30s) if I get a 429 code (rate limited)
s
Stéphan Taljaard
03/17/2022, 6:15 PM
Hi Marc! I'm not sure of exact details, but I think you can add an if statement for those that you
want
to retry, the use signals to indicate that those should be retried
https://docs.prefect.io/api/latest/engine/signals.html#retry
m
Marc Lipoff
03/17/2022, 6:16 PM
How do I incude a wait time and/or max retries?
k
Kevin Kho
03/17/2022, 6:21 PM
You can get the error in the state handler for failed runs using
new_state.result
. Have you seen state handlers?
#prefect-community
Join Slack