Skip to content

Commit

Permalink
Merge pull request #45 from roboduels/develop
Browse files Browse the repository at this point in the history
Revert retry mechanism back
  • Loading branch information
sarikaya authored May 10, 2024
2 parents 56a233d + 49dedf1 commit c7136b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions cvat/apps/engine/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def create(tid, data):
"""Schedule the task"""
q = django_rq.get_queue('default')
q.enqueue_call(func=_create_thread, args=(tid, data),
job_id="/api/v1/tasks/{}".format(tid),
retry=django_rq.Retry(max=3, interval=[10, 60, 180]))
job_id="/api/v1/tasks/{}".format(tid))

@transaction.atomic
def rq_handler(job, exc_type, exc_value, traceback):
Expand Down
12 changes: 4 additions & 8 deletions cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,7 @@ def create(self, request):
meta={
'tmp_file': filename,
'tmp_file_descriptor': fd,
},
retry=django_rq.Retry(max=3, interval=[10, 60, 180])
}
)

else:
Expand Down Expand Up @@ -566,8 +565,7 @@ def retrieve(self, request, pk=None):
args=(pk, 'task_dump.zip'),
job_id=rq_id,
meta={'request_time': timezone.localtime()},
result_ttl=ttl, failure_ttl=ttl,
retry=django_rq.Retry(max=3, interval=[10, 60, 180]))
result_ttl=ttl, failure_ttl=ttl)
return Response(status=status.HTTP_202_ACCEPTED)

else:
Expand Down Expand Up @@ -1594,8 +1592,7 @@ def _import_annotations(request, rq_id, rq_func, pk, format_name):
rq_job = queue.enqueue_call(
func=rq_func,
args=(pk, filename, format_name),
job_id=rq_id,
retry=django_rq.Retry(max=3, interval=[10, 60, 180])
job_id=rq_id
)
rq_job.meta['tmp_file'] = filename
rq_job.meta['tmp_file_descriptor'] = fd
Expand Down Expand Up @@ -1689,8 +1686,7 @@ def _export_annotations(db_instance, rq_id, request, format_name, action, callba
queue.enqueue_call(func=callback,
args=(db_instance.id, format_name, server_address), job_id=rq_id,
meta={'request_time': timezone.localtime()},
result_ttl=ttl, failure_ttl=ttl,
retry=django_rq.Retry(max=3, interval=[10, 60, 180]))
result_ttl=ttl, failure_ttl=ttl)
return Response(status=status.HTTP_202_ACCEPTED)


Expand Down

0 comments on commit c7136b9

Please sign in to comment.