From aa8454ee6f18f592e3d679cfde036fd77da111ab Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 26 Apr 2013 16:48:59 +0400 Subject: [PATCH] remove inactive sessions after 1000s --- processor.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/processor.py b/processor.py index 9fa9378..ec62d48 100644 --- a/processor.py +++ b/processor.py @@ -177,8 +177,9 @@ class RequestDispatcher(threading.Thread): sessions = self.sessions[:] active_sessions = [] + now = time.time() for session in sessions: - if not session.stopped(): + if not session.stopped() and (now - session.time) < 1000: # If session is still alive then re-add it back # to our internal register active_sessions.append(session) -- 1.7.1