1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 08:56:17 +00:00

Fix(?) watcher queue sometimes not stopping when asked

Ref #263
This commit is contained in:
Alban Féron 2024-04-14 15:59:51 +02:00
parent 1cfca94109
commit 4a0437b5e2
No known key found for this signature in database
GPG Key ID: 8CE0313646D16165

View File

@ -141,7 +141,10 @@ class ScannerProcessingQueue(Thread):
time.sleep(0.1) time.sleep(0.1)
with self.__cond: with self.__cond:
self.__cond.wait() # Flag might have flipped during sleep. Check it again before waiting
# See issue #263
if self.__running:
self.__cond.wait()
if not self.__queue: if not self.__queue:
continue continue
@ -195,8 +198,8 @@ class ScannerProcessingQueue(Thread):
scanner.add_cover(item.path) scanner.add_cover(item.path)
def stop(self): def stop(self):
self.__running = False
with self.__cond: with self.__cond:
self.__running = False
self.__cond.notify() self.__cond.notify()
def put(self, path, operation, **kwargs): def put(self, path, operation, **kwargs):