Skip to content

Commit b2c2b14

Browse files
Fix timeouts and pass param validation
1 parent 9b95415 commit b2c2b14

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

catalog/dags/maintenance/decode_and_deduplicate_image_tags.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def decode_and_deduplicate_image_tags():
7474
task_id="trigger_batched_update",
7575
trigger_dag_id=BATCHED_UPDATE_DAG_ID,
7676
wait_for_completion=True,
77-
execution_timeout=timedelta(hours=5),
7877
retries=0,
7978
conf={
8079
"query_id": DAG_ID,
@@ -91,8 +90,7 @@ def decode_and_deduplicate_image_tags():
9190
).strip(),
9291
"update_query": dedent(
9392
f"""
94-
SET
95-
updated_on = now(),
93+
SET updated_on = NOW(),
9694
tags = (
9795
SELECT jsonb_agg(deduplicated.tag) FROM (
9896
SELECT DISTINCT ON (all_tags.tag->'name', all_tags.tag->'provider')
@@ -120,6 +118,7 @@ def decode_and_deduplicate_image_tags():
120118
)
121119
"""
122120
).strip(),
121+
"update_timeout": int(timedelta(hours=10).total_seconds()),
123122
"dry_run": False,
124123
},
125124
)

catalog/dags/maintenance/trim_and_deduplicate_tags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def trim_and_deduplicate_tags():
3232
task_id=DAG_ID,
3333
trigger_dag_id=BATCHED_UPDATE_DAG_ID,
3434
wait_for_completion=True,
35-
execution_timeout=timedelta(hours=5),
3635
max_active_tis_per_dag=2,
3736
map_index_template="""{{ task.conf['table_name'] }}""",
3837
retries=0,
@@ -56,7 +55,7 @@ def trim_and_deduplicate_tags():
5655
)
5756
),
5857
"update_query": (
59-
"SET updated_on = now(), "
58+
"SET updated_on = NOW(), "
6059
+ dedent(
6160
f"""
6261
tags = (
@@ -78,6 +77,7 @@ def trim_and_deduplicate_tags():
7877
"""
7978
)
8079
),
80+
"update_timeout": int(timedelta(hours=5).total_seconds()),
8181
"dry_run": False,
8282
}
8383
for media_type in MEDIA_TYPES

0 commit comments

Comments
 (0)