Skip to content

Commit 146c62a

Browse files
authored
adding better logging of error (#235)
1 parent c4f4f87 commit 146c62a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

materializationengine/workflows/periodic_materialization.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def process_datastack(datastack, days_to_expire, merge_tables):
3535
.count()
3636
)
3737
if valid_databases >= max_databases:
38-
return f"Number of valid materialized databases is {valid_databases}, threshold is set to: {max_databases}"
38+
celery_logger.info("Number of valid materialized databases is {valid_databases}, threshold is set to: {max_databases}")
39+
return False
3940
datastack_info["database_expires"] = True
4041
task = run_complete_workflow.s(
4142
datastack_info, days_to_expire=days_to_expire, merge_tables=merge_tables
@@ -74,6 +75,8 @@ def run_periodic_materialization(
7475
for datastack in datastacks:
7576
try:
7677
is_running = process_datastack(datastack, days_to_expire, merge_tables)
78+
if not is_running:
79+
celery_logger.error(f"Materialization workflow for {datastack} is not running: {is_running}")
7780
except Exception as e:
7881
celery_logger.error(e)
7982
raise e

0 commit comments

Comments
 (0)