listener: don't add elements if queue is full
When Solaar is loaded, if a large number of events happen, it will lose the register events, as the queue size is too small (16). So, check if the queue is full, in order to avoid losing those important events. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
a4b7194490
commit
632d8804be
|
@ -222,6 +222,7 @@ class EventsListener(_threading.Thread):
|
||||||
if self._active: # and _threading.current_thread() == self:
|
if self._active: # and _threading.current_thread() == self:
|
||||||
# if _log.isEnabledFor(_DEBUG):
|
# if _log.isEnabledFor(_DEBUG):
|
||||||
# _log.debug("queueing unhandled %s", n)
|
# _log.debug("queueing unhandled %s", n)
|
||||||
|
if not self._queued_notifications.full():
|
||||||
self._queued_notifications.put(n)
|
self._queued_notifications.put(n)
|
||||||
|
|
||||||
def __bool__(self):
|
def __bool__(self):
|
||||||
|
|
Loading…
Reference in New Issue