Fix error in new idle timeout, causing it not to deactivate properly.

This commit is contained in:
Griatch 2017-08-27 18:32:05 +02:00
parent 4505ace90d
commit ceb66568b1

View file

@ -129,12 +129,13 @@ def _server_maintenance():
evennia.CHANNEL_HANDLER.update()
# handle idle timeouts
reason = _("idle timeout exceeded")
for session in (sess for sess in SESSIONS.values()
if (now - sess.cmd_last) > _IDLE_TIMEOUT):
if not session.account or not \
session.account.access(session.account, "noidletimeout", default=False):
SESSIONS.disconnect(session, reason=reason)
if _IDLE_TIMEOUT > 0:
reason = _("idle timeout exceeded")
for session in (sess for sess in SESSIONS.values()
if (now - sess.cmd_last) > _IDLE_TIMEOUT):
if not session.account or not \
session.account.access(session.account, "noidletimeout", default=False):
SESSIONS.disconnect(session, reason=reason)
# Commenting this out, it is probably not needed
# with CONN_MAX_AGE set. Keeping it as a reminder