From fb662d06b73693f222878a01321ccdbe478ef5b2 Mon Sep 17 00:00:00 2001 From: tgoff0 Date: Thu, 5 Feb 2015 00:15:38 +0000 Subject: [PATCH] daemon: Ignore redundant session state changes. --- daemon/core/session.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/core/session.py b/daemon/core/session.py index 6c58a6eb..dea57a59 100644 --- a/daemon/core/session.py +++ b/daemon/core/session.py @@ -74,6 +74,7 @@ class Session(object): self._confobjslock = threading.Lock() self._handlers = set() self._handlerslock = threading.Lock() + self._state = None self._hooks = {} self.setstate(state=coreapi.CORE_EVENT_DEFINITION_STATE, info=False, sendevent=False) @@ -221,6 +222,8 @@ class Session(object): true, generate a CORE API Event Message and send to the connected entity. ''' + if state == self._state: + return [] self._time = time.time() self._state = state replies = []