Fix error in MonitorHandler recovering a saved Session across a reload. This probably affected the TickerHandler as well. Add a new hook to the server object that gets called once the portal has synced, and run the monitorhandler/tickerhandler restores there. Also some changes to the serialization of Sessions. Resolves #1164.

This commit is contained in:
Griatch 2017-01-15 19:55:51 +01:00
parent b46bc9b2aa
commit 052e1845a2
6 changed files with 70 additions and 34 deletions

View file

@ -355,7 +355,10 @@ def _on_monitor_change(**kwargs):
obj = kwargs["obj"]
name = kwargs["name"]
session = kwargs["session"]
session.msg(monitor={"name": name, "value": _GA(obj, fieldname)})
# the session may be None if the char quits and someone
# else then edits the object
if session:
session.msg(monitor={"name": name, "value": _GA(obj, fieldname)})
def monitor(session, *args, **kwargs):