From fd1b0818c5773288079b2d60b126c7f3afb7f391 Mon Sep 17 00:00:00 2001 From: DmitriyOparin <35344996+DmitriyOparin@users.noreply.github.com> Date: Wed, 24 Feb 2021 15:16:30 +0300 Subject: [PATCH] receive and send max_distance value (#2856) Co-authored-by: Dmitriy Oparin --- cvat/apps/lambda_manager/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cvat/apps/lambda_manager/views.py b/cvat/apps/lambda_manager/views.py index c7986394f6df..dde894c5153b 100644 --- a/cvat/apps/lambda_manager/views.py +++ b/cvat/apps/lambda_manager/views.py @@ -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 @@ -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) @@ -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 @@ -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()