Skip to content

Commit

Permalink
Try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Marishka17 committed Jan 9, 2025
1 parent aab5350 commit 7da8a17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cvat/apps/dataset_manager/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _cleanup(self) -> None:
# In that case an exception is expected and is handled by the cron process.
# 2. A temporary file/directory can be removed by the cron job only when it is outdated.
# 3. Each temporary file/directory has a unique name, so the race condition when one process is creating an object
# and another is removing it - impossible.
# and another is removing it - impossible.
for child in os.scandir(TmpDirManager.TMP_ROOT):
# stop clean up process correctly before rq job timeout is ended
if self._stop_event.is_set():
Expand Down
4 changes: 3 additions & 1 deletion cvat/apps/dataset_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ def export(

with TmpDirManager.get_tmp_directory_for_export(instance_type=instance_type) as temp_dir:
temp_file = osp.join(temp_dir, 'result')
temp_subdir = osp.join(temp_dir, 'subdir')
os.makedirs(temp_subdir, exist_ok=True)
export_fn(db_instance.id, temp_file, format_name=dst_format,
server_url=server_url, save_images=save_images, temp_dir=temp_dir)
server_url=server_url, save_images=save_images, temp_dir=temp_subdir)
with get_export_cache_lock(
output_path,
ttl=EXPORT_CACHE_LOCK_TTL,
Expand Down
1 change: 0 additions & 1 deletion cvat/apps/engine/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,6 @@ def _import(importer, request, queue, rq_id, Serializer, file_field_name, locati
return Response(serializer.data, status=status.HTTP_202_ACCEPTED)

def get_backup_dirname():
# FUTURE-FIXME
return TmpDirManager.TMP_ROOT

def import_project(request, queue_name, filename=None):
Expand Down

0 comments on commit 7da8a17

Please sign in to comment.