Skip to content

Commit cb7e107

Browse files
Copilotjpn--
andcommitted
Wrap mem.consolidate_logs in try-except to prevent model run crashes
Co-authored-by: jpn-- <[email protected]>
1 parent 2f77bb6 commit cb7e107

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

activitysim/cli/run.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,13 @@ def run(args):
449449
raise
450450

451451
chunk.consolidate_logs(state)
452-
mem.consolidate_logs(state)
452+
try:
453+
mem.consolidate_logs(state)
454+
except Exception as e:
455+
logger.warning(
456+
f"Memory log consolidation failed with error: {e}. "
457+
"This does not affect model results, but memory usage logs will not be consolidated."
458+
)
453459

454460
from activitysim.core.flow import TimeLogger
455461

0 commit comments

Comments
 (0)