1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-19 13:29:42 +02:00

add locking

This commit is contained in:
dbarzin 2023-03-04 19:13:16 +01:00
parent 9231c6a4e3
commit a3441cfcbf

View file

@ -116,12 +116,19 @@ class scanThread (threading.Thread):
if file_size > (1024 * 1024 * 1024):
status = "TOO BIG"
else:
queueLock.acquire()
res = pandora.submit_from_disk(file)
logging.info(f'pandora_red="{res}"')
logging.info(f'pandora_res="{res}"')
queueLock.release()
time.sleep(0.1)
loop = 0
while loop < (1024 * 256):
queueLock.acquire()
res = pandora.task_status(res["taskId"])
logging.info(f'pandora_res="{res}"')
queueLock.release()
# Handle responde from Pandora
if (res['success'] and (loop < 100)):