From 46900f835cf2b57c861659625e243aeef26cadec Mon Sep 17 00:00:00 2001 From: George Hindle Date: Sun, 3 May 2020 22:09:11 +0100 Subject: [PATCH] Enforce ordered popping of jobs off the database queue --- src/WP_Queue/Connections/DatabaseConnection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WP_Queue/Connections/DatabaseConnection.php b/src/WP_Queue/Connections/DatabaseConnection.php index dc5adac..367b662 100644 --- a/src/WP_Queue/Connections/DatabaseConnection.php +++ b/src/WP_Queue/Connections/DatabaseConnection.php @@ -68,7 +68,7 @@ public function pop() { SELECT * FROM {$this->jobs_table} WHERE reserved_at IS NULL AND available_at <= %s - ORDER BY available_at + ORDER BY available_at, id LIMIT 1 ", $this->datetime() ); @@ -256,4 +256,4 @@ protected function format_exception( Exception $exception ) { return $string; } -} \ No newline at end of file +}