Skip to content

Commit e1f9b2a

Browse files
Copilotjpn--
andauthored
Wrap mem.consolidate_logs in try-except to prevent model run crashes (#979)
* Initial plan * Wrap mem.consolidate_logs in try-except to prevent model run crashes Co-authored-by: jpn-- <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jpn-- <[email protected]> Co-authored-by: Jeffrey Newman <[email protected]>
1 parent 1a94629 commit e1f9b2a

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
@@ -452,7 +452,13 @@ def run(args):
452452
raise
453453

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

457463
from activitysim.core.flow import TimeLogger
458464

0 commit comments

Comments
 (0)