Skip to content

Commit

Permalink
Set ordering on tasks for processing
Browse files Browse the repository at this point in the history
If several tasks are available in the queue, the command should take the tasks with the lowest ETA.
  • Loading branch information
nezhar authored Aug 29, 2024
1 parent acecd28 commit e505df4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _handle_options(self, options):
def tasks_for_processing():
return FutureTask.objects.filter(
eta__lte=timezone.now(), status=FutureTask.FUTURE_TASK_STATUS_OPEN
)
).order_by('eta')

@staticmethod
def _convert_exception_args(args):
Expand Down

0 comments on commit e505df4

Please sign in to comment.