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