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,7 +222,8 @@ class EventsListener(_threading.Thread):
|
|||
if self._active: # and _threading.current_thread() == self:
|
||||
# if _log.isEnabledFor(_DEBUG):
|
||||
# _log.debug("queueing unhandled %s", n)
|
||||
self._queued_notifications.put(n)
|
||||
if not self._queued_notifications.full():
|
||||
self._queued_notifications.put(n)
|
||||
|
||||
def __bool__(self):
|
||||
return bool(self._active and self.receiver)
|
||||
|
|
Loading…
Reference in New Issue