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

minor changes

This commit is contained in:
dbarzin 2023-03-04 19:28:00 +01:00
parent a3441cfcbf
commit cb97abb2a4

View file

@ -102,11 +102,11 @@ class scanThread (threading.Thread):
file_size = os.path.getsize(file) file_size = os.path.getsize(file)
# log the scan has started # log the scan has started
log( # log(
f'Scan {file_name} ' # f'Scan {file_name} '
f'[{human_readable_size(file_size)}] ' # f'[{human_readable_size(file_size)}] '
f'Thread-{id} ' # f'Thread-{id} ')
)
file_scan_start_time = time.time() file_scan_start_time = time.time()
if is_fake_scan: if is_fake_scan:
status = "SKIPPED" status = "SKIPPED"
@ -118,7 +118,6 @@ class scanThread (threading.Thread):
else: else:
queueLock.acquire() queueLock.acquire()
res = pandora.submit_from_disk(file) res = pandora.submit_from_disk(file)
logging.info(f'pandora_res="{res}"')
queueLock.release() queueLock.release()
time.sleep(0.1) time.sleep(0.1)
@ -127,16 +126,15 @@ class scanThread (threading.Thread):
while loop < (1024 * 256): while loop < (1024 * 256):
queueLock.acquire() queueLock.acquire()
res = pandora.task_status(res["taskId"]) res = pandora.task_status(res["taskId"])
logging.info(f'pandora_res="{res}"')
queueLock.release() queueLock.release()
# Handle responde from Pandora # Handle responde from Pandora
if (res['success'] and (loop < 100)): status = res["status"]
status = res["status"] if (status != "WAITING"):
if (status != "WAITING"): break
break
# wait a little # wait a little
pass
time.sleep(0.1) time.sleep(0.1)
loop += 1 loop += 1