Skip to content

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

Limit to 2 `alter_data_batches` concurrently (#5125)

Staci Mullins071e4221721c
diff --git a/catalog/dags/data_refresh/alter_data.py b/catalog/dags/data_refresh/alter_data.py
index 0c490a2c1..1a9481da4 100644
--- a/catalog/dags/data_refresh/alter_data.py
+++ b/catalog/dags/data_refresh/alter_data.py
@@ -124,7 +124,7 @@ def get_alter_batches(
return [(x, x + batch_size - 1) for x in range(start, stop, batch_size)]
-@task
+@task(max_active_tis_per_dagrun=2)
def alter_data_batch(
batch: tuple[int, int],
temp_table: str,
@@ -203,7 +203,8 @@ def alter_table_data(
)
alter_data = alter_data_batch.partial(
- temp_table=temp_table, postgres_conn_id=postgres_conn_id
+ temp_table=temp_table,
+ postgres_conn_id=postgres_conn_id,
).expand(batch=batches)
report(alter_data)