Skip to content

Commit

Permalink
Fix LambdaQueue.get_jobs method (#7231)
Browse files Browse the repository at this point in the history
Since rq Job.fetch_many
(https://github.com/rq/rq/blob/d11094af95188c197a5e11b1c4fa05b000485370/rq/job.py#L604)
can return `None` we must explicitly check that job exists.
  • Loading branch information
Marishka17 authored Dec 6, 2023
1 parent 67b80c2 commit 571e622
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cvat/apps/lambda_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def get_jobs(self):
queue.deferred_job_registry.get_job_ids())
jobs = queue.job_class.fetch_many(job_ids, queue.connection)

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

def enqueue(self,
lambda_func, threshold, task, quality, mapping, cleanup, conv_mask_to_poly, max_distance, request,
Expand Down

0 comments on commit 571e622

Please sign in to comment.