# HG changeset patch # User souliane # Date 1411410400 -7200 # Node ID b5928601d7aa6782266b19f61f45137fa87a7f21 # Parent 628e320eab1f27937cd3a817258a7e80fd2f06b9 memory: handle the case where an existing session ID is re-used for creating a new session diff -r 628e320eab1f -r b5928601d7aa src/memory/memory.py --- a/src/memory/memory.py Sun Sep 21 13:10:55 2014 +0200 +++ b/src/memory/memory.py Mon Sep 22 20:26:40 2014 +0200 @@ -57,6 +57,9 @@ """ if session_id is None: session_id = str(uuid4()) + elif session_id in self._sessions: + self._sessions[session_id][0].cancel() + log.warning("Session [{id}] is going to be re-initialised".format(id=session_id)) timer = reactor.callLater(self.timeout, self._purgeSession, session_id) if session_data is None: session_data = {}