Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Allow default retry count to be determined by environment variable (#806)

Meet Parekh895e907b6f95
diff --git a/env.template b/env.template
index 58f5324e1..2511cb1c9 100644
--- a/env.template
+++ b/env.template
@@ -104,3 +104,5 @@ COMMONCRAWL_BUCKET=not_set
# Seconds to wait before poking for availability of the data refresh pool when running a data_refresh
# DAG. Used to shorten the time for testing purposes.
DATA_REFRESH_POKE_INTERVAL=5
+# Number of Retries if DAG task fails to run
+DEFAULT_RETRY_COUNT = 2
diff --git a/openverse_catalog/dags/common/constants.py b/openverse_catalog/dags/common/constants.py
index c4b5bbf28..274ed3e14 100644
--- a/openverse_catalog/dags/common/constants.py
+++ b/openverse_catalog/dags/common/constants.py
@@ -22,7 +22,7 @@ DAG_DEFAULT_ARGS = {
"email_on_failure": False,
"email_on_retry": False,
"email": [CONTACT_EMAIL],
- "retries": 2,
+ "retries": int(os.getenv("DEFAULT_RETRY_COUNT", 2)),
"retry_delay": timedelta(minutes=5),
"execution_timeout": timedelta(hours=1),
"on_failure_callback": slack.on_failure_callback,