From d21c8ac4f30ede2b189cf6aa27859df1841b7e18 Mon Sep 17 00:00:00 2001 From: Gugiman Date: Thu, 8 Feb 2018 10:32:47 +0100 Subject: [PATCH] Order by publish_date within priorities --- pkg/dbal/DbalConsumer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/dbal/DbalConsumer.php b/pkg/dbal/DbalConsumer.php index 69b11dbb0..796b27a55 100644 --- a/pkg/dbal/DbalConsumer.php +++ b/pkg/dbal/DbalConsumer.php @@ -213,6 +213,7 @@ private function fetchPrioritizedMessage($now) ->andWhere('priority IS NOT NULL') ->andWhere('(delayed_until IS NULL OR delayed_until <= :delayedUntil)') ->addOrderBy('priority', 'desc') + ->addOrderBy('published_at', 'asc') ->setMaxResults(1) ;