mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-22 23:09:41 +02:00
minor changes
This commit is contained in:
parent
a3441cfcbf
commit
cb97abb2a4
1 changed files with 9 additions and 11 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue