Skip to content

Commit d02c657

Browse files
authored
Consumer receive should only fetch one message
When looping the worker->work() call, the receive method will fetch all messages in the queue, but only return the last one. The fix will return only one message.
1 parent 93cfb73 commit d02c657

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/gearman/GearmanConsumer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function receive(int $timeout = 0): ?Message
5959
$message = GearmanMessage::jsonUnserialize($job->workload());
6060
});
6161

62-
while ($this->worker->work());
62+
$this->worker->work();
6363
} finally {
6464
restore_error_handler();
6565
}

0 commit comments

Comments
 (0)