Skip to content

Commit

Permalink
Remove the per-task artifacts directory (#7597)
Browse files Browse the repository at this point in the history
This was only used by the Git synchronization functionality, which was
removed in #6904.
  • Loading branch information
SpecLad authored Mar 22, 2024
1 parent 173b970 commit 8729f45
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cvat/apps/engine/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def _write_data(zip_object):
if os.path.isdir(task_path):
shutil.rmtree(task_path)

os.makedirs(self._db_task.get_task_artifacts_dirname())
os.makedirs(task_path)

if not self._labels_mapping:
self._labels_mapping = self._create_labels(db_task=self._db_task, labels=labels)
Expand Down
3 changes: 0 additions & 3 deletions cvat/apps/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,6 @@ def get_labels(self):
def get_dirname(self):
return os.path.join(settings.TASKS_ROOT, str(self.id))

def get_task_artifacts_dirname(self):
return os.path.join(self.get_dirname(), 'artifacts')

def get_tmp_dirname(self):
return os.path.join(self.get_dirname(), "tmp")

Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ def create(self, validated_data):
if os.path.isdir(task_path):
shutil.rmtree(task_path)

os.makedirs(db_task.get_task_artifacts_dirname())
os.makedirs(task_path)

LabelSerializer.create_labels(labels, parent_instance=db_task)

Expand Down
1 change: 0 additions & 1 deletion cvat/apps/engine/tests/test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def create_db_task(data):
db_task = Task.objects.create(**data)
shutil.rmtree(db_task.get_dirname(), ignore_errors=True)
os.makedirs(db_task.get_dirname())
os.makedirs(db_task.get_task_artifacts_dirname())
db_task.data = db_data
db_task.save()

Expand Down

0 comments on commit 8729f45

Please sign in to comment.