mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-07 02:37:32 +08:00
fix(C1): wrap handler call in try/finally to always save progress
This commit is contained in:
@@ -125,8 +125,10 @@ class GuidedLearningCapability(BaseCapability):
|
||||
await stream.content("学习流程已完成。进入复习阶段。")
|
||||
return
|
||||
|
||||
await handler(self, progress, context, stream)
|
||||
self._service.save(progress)
|
||||
try:
|
||||
await handler(self, progress, context, stream)
|
||||
finally:
|
||||
self._service.save(progress)
|
||||
|
||||
# ── §2 Diagnostic ────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user