Skip to content

Commit 2e35220

Browse files
committed
fix upload
1 parent eca5261 commit 2e35220

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
addopts = -n auto --dist=loadscope
6+
;addopts = -n auto --dist=loadscope

src/superannotate/lib/core/usecases/annotations.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def __init__(
120120
self._annotation_upload_data = None
121121
self._item_ids = []
122122
self._s3_bucket = None
123-
self._big_files_queue = asyncio.Queue()
124-
self._small_files_queue = asyncio.Queue()
123+
self._big_files_queue = None
124+
self._small_files_queue = None
125125
self._report = Report([], [], [], [])
126126

127127
@staticmethod
@@ -334,7 +334,6 @@ async def upload(_chunk):
334334
self._report.missing_attrs.extend(report.missing_attrs)
335335
except Exception:
336336
import traceback
337-
338337
traceback.print_exc()
339338
self._report.failed_annotations.extend([i.name for i in chunk])
340339

@@ -408,6 +407,8 @@ async def distribute_queues(self, items_to_upload: list):
408407
else:
409408
self._small_files_queue.put_nowait(t_item)
410409
except (ValidationError, AppException):
410+
data[idx][1] = True
411+
self.reporter.update_progress()
411412
self._report.failed_annotations.append(item.name)
412413
finally:
413414
data[idx][1] = True
@@ -417,6 +418,8 @@ async def distribute_queues(self, items_to_upload: list):
417418

418419
async def run_workers(self, items_to_upload):
419420
try:
421+
self._big_files_queue = asyncio.Queue()
422+
self._small_files_queue = asyncio.Queue()
420423
await asyncio.gather(
421424
self.distribute_queues(items_to_upload),
422425
self.upload_small_annotations(),

0 commit comments

Comments
 (0)