Skip to content

Commit

Permalink
Add failure_ttl when enqueueing task creation job (#7475)
Browse files Browse the repository at this point in the history
By default failed rq jobs are kept for 1 year. It is too long and leads
to keeping a lot of unnecessary results in Redis.
  • Loading branch information
Marishka17 authored Feb 13, 2024
1 parent 58173c4 commit b2a1065
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cvat/apps/engine/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def create(db_task, data, request):
job_id=f"create:task.id{db_task.pk}",
meta=get_rq_job_meta(request=request, db_obj=db_task),
depends_on=define_dependent_job(q, user_id),
failure_ttl=settings.IMPORT_CACHE_FAILED_TTL.total_seconds(),
)

############################# Internal implementation for server API
Expand Down
2 changes: 1 addition & 1 deletion cvat/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class CVAT_QUEUES(Enum):

BUCKET_CONTENT_MAX_PAGE_SIZE = 500

IMPORT_CACHE_FAILED_TTL = timedelta(days=90)
IMPORT_CACHE_FAILED_TTL = timedelta(days=30)
IMPORT_CACHE_SUCCESS_TTL = timedelta(hours=1)
IMPORT_CACHE_CLEAN_DELAY = timedelta(hours=12)

Expand Down

0 comments on commit b2a1065

Please sign in to comment.