Skip to content

Commit b278a59

Browse files
committed
Wait for 1 sec in tqdm thread
1 parent 207b672 commit b278a59

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

superannotate/db/projects.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
_api = API.get_instance()
4343
_NUM_THREADS = 10
44+
_TIME_TO_UPDATE_IN_TQDM = 1
4445

4546

4647
def create_project(project_name, project_description, project_type):
@@ -1427,7 +1428,7 @@ def __upload_preannotations_thread(
14271428
def __tqdm_thread_upload(total_num, uploaded, couldnt_upload, finish_event):
14281429
with tqdm(total=total_num) as pbar:
14291430
while True:
1430-
finished = finish_event.wait(5)
1431+
finished = finish_event.wait(_TIME_TO_UPDATE_IN_TQDM)
14311432
if not finished:
14321433
sum_all = 0
14331434
for i in couldnt_upload:
@@ -1445,7 +1446,7 @@ def __tqdm_thread_upload_annotations(
14451446
):
14461447
with tqdm(total=total_num) as pbar:
14471448
while True:
1448-
finished = finish_event.wait(5)
1449+
finished = finish_event.wait(_TIME_TO_UPDATE_IN_TQDM)
14491450
if not finished:
14501451
sum_all = 0
14511452
for i in couldnt_upload:
@@ -1465,7 +1466,7 @@ def __tqdm_thread_upload_preannotations(
14651466
):
14661467
with tqdm(total=total_num) as pbar:
14671468
while True:
1468-
finished = finish_event.wait(5)
1469+
finished = finish_event.wait(_TIME_TO_UPDATE_IN_TQDM)
14691470
if not finished:
14701471
sum_all = 0
14711472
for i in couldnt_upload:

0 commit comments

Comments
 (0)