daemon: Ignore redundant session state changes.

This commit is contained in:
tgoff0 2015-02-05 00:15:38 +00:00
parent dfdc1fe671
commit fb662d06b7

View file

@ -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 = []