Fix regression with idle_timout not correctly closing connection. Fix errors due to Portal and Server trying to send to non-existing sessions after connection closes.

This commit is contained in:
Griatch 2016-09-14 19:07:59 +02:00
parent 2737d37633
commit 67411d006d
2 changed files with 7 additions and 3 deletions

View file

@ -87,7 +87,7 @@ def _portal_maintenance():
reason = "Idle timeout exceeded, disconnecting."
for session in [sess for sess in PORTAL_SESSIONS.values()
if (now - sess.cmd_last) > _IDLE_TIMEOUT]:
session.data_out(text=[[reason], {}])
session.disconnect(reason=reason)
PORTAL_SESSIONS.disconnect(session)
if _IDLE_TIMEOUT > 0: