Skip to content

Commit

Permalink
receive and send max_distance value (#2856)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitriy Oparin <[email protected]>
  • Loading branch information
DmitriyOparin and Dmitriy Oparin authored Feb 24, 2021
1 parent ad25104 commit fd1b081
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cvat/apps/lambda_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def get_jobs(self):

return [LambdaJob(job) for job in jobs if job.meta.get("lambda")]

def enqueue(self, lambda_func, threshold, task, quality, mapping, cleanup):
def enqueue(self, lambda_func, threshold, task, quality, mapping, cleanup, max_distance):
jobs = self.get_jobs()
# It is still possible to run several concurrent jobs for the same task.
# But the race isn't critical. The filtration is just a light-weight
Expand All @@ -264,7 +264,8 @@ def enqueue(self, lambda_func, threshold, task, quality, mapping, cleanup):
"task": task,
"quality": quality,
"cleanup": cleanup,
"mapping": mapping
"mapping": mapping,
"max_distance": max_distance
})

queue.enqueue_job(job)
Expand Down Expand Up @@ -596,6 +597,7 @@ def create(self, request):
quality = request.data.get("quality")
cleanup = request.data.get('cleanup', False)
mapping = request.data.get('mapping')
max_distance = request.data.get('max_distance')

db_task = TaskModel.objects.get(pk=task)
# Check that the user has enough permissions to modify
Expand All @@ -611,7 +613,7 @@ def create(self, request):
queue = LambdaQueue()
lambda_func = gateway.get(function)
job = queue.enqueue(lambda_func, threshold, task, quality,
mapping, cleanup)
mapping, cleanup, max_distance)

return job.to_dict()

Expand Down

0 comments on commit fd1b081

Please sign in to comment.