diff --git a/cvat/apps/dataset_manager/views.py b/cvat/apps/dataset_manager/views.py index 1df6384ec8b..a8e6af59803 100644 --- a/cvat/apps/dataset_manager/views.py +++ b/cvat/apps/dataset_manager/views.py @@ -135,6 +135,8 @@ def export( export_fn = task.export_job db_instance = Job.objects.get(pk=job_id) + db_instance.touch_last_export_date() + cache_ttl = get_export_cache_ttl(db_instance) cache_dir = db_instance.get_export_cache_directory(create=True) diff --git a/cvat/apps/engine/background.py b/cvat/apps/engine/background.py index 41116b7c3a0..23b5aa838b3 100644 --- a/cvat/apps/engine/background.py +++ b/cvat/apps/engine/background.py @@ -493,8 +493,6 @@ def setup_background_job( failure_ttl=cache_ttl.total_seconds(), ) - self.db_instance.touch_last_export_date() - def get_v1_endpoint_view_name(self) -> str: """ Get view name of the endpoint for the first API version @@ -766,8 +764,6 @@ def setup_background_job( failure_ttl=cache_ttl.total_seconds(), ) - self.db_instance.touch_last_export_date() - def get_v1_endpoint_view_name(self) -> str: """Get view name of the endpoint for the first API version""" diff --git a/cvat/apps/engine/backup.py b/cvat/apps/engine/backup.py index 242db4a52c6..62786195a64 100644 --- a/cvat/apps/engine/backup.py +++ b/cvat/apps/engine/backup.py @@ -16,7 +16,6 @@ from tempfile import NamedTemporaryFile from typing import Any, Collection, Dict, Iterable, Optional, Union, Type from zipfile import ZipFile -import logging from datetime import timedelta import django_rq @@ -1031,11 +1030,12 @@ def create_backup( # FUTURE-FIXME: there db_instance_id should be passed db_instance: models.Project | models.Task, Exporter: Type[ProjectExporter | TaskExporter], - logger: logging.Logger, + logger: Logger, cache_ttl: timedelta, ): try: cache_dir = db_instance.get_export_cache_directory(create=True) + db_instance.touch_last_export_date() db_instance.refresh_from_db(fields=['updated_date']) instance_timestamp = timezone.localtime(db_instance.updated_date).timestamp()