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:
parent
9231c6a4e3
commit
a3441cfcbf
1 changed files with 8 additions and 1 deletions
|
@ -116,12 +116,19 @@ class scanThread (threading.Thread):
|
||||||
if file_size > (1024 * 1024 * 1024):
|
if file_size > (1024 * 1024 * 1024):
|
||||||
status = "TOO BIG"
|
status = "TOO BIG"
|
||||||
else:
|
else:
|
||||||
|
queueLock.acquire()
|
||||||
res = pandora.submit_from_disk(file)
|
res = pandora.submit_from_disk(file)
|
||||||
logging.info(f'pandora_red="{res}"')
|
logging.info(f'pandora_res="{res}"')
|
||||||
|
queueLock.release()
|
||||||
|
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
loop = 0
|
loop = 0
|
||||||
|
|
||||||
while loop < (1024 * 256):
|
while loop < (1024 * 256):
|
||||||
|
queueLock.acquire()
|
||||||
res = pandora.task_status(res["taskId"])
|
res = pandora.task_status(res["taskId"])
|
||||||
|
logging.info(f'pandora_res="{res}"')
|
||||||
|
queueLock.release()
|
||||||
|
|
||||||
# Handle responde from Pandora
|
# Handle responde from Pandora
|
||||||
if (res['success'] and (loop < 100)):
|
if (res['success'] and (loop < 100)):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue