fixbug: 基于全memory数据存储的流程异常恢复

This commit is contained in:
莘权 马 2023-12-25 12:42:23 +08:00
parent 3be990ea3f
commit 780caf011d
5 changed files with 44 additions and 7 deletions

View file

@ -93,4 +93,8 @@ async def test_role_serdeser_interrupt():
assert new_role_a._rc.state == 1
with pytest.raises(Exception):
await role_c.run(with_message=Message(content="demo", cause_by=UserRequirement))
await new_role_a.run(with_message=Message(content="demo", cause_by=UserRequirement))
if __name__ == "__main__":
pytest.main([__file__, "-s"])

View file

@ -85,3 +85,4 @@ class RoleC(Role):
self._init_actions([ActionOK, ActionRaise])
self._watch([UserRequirement])
self._rc.react_mode = RoleReactMode.BY_ORDER
self._rc.memory.ignore_id = True