Skip to content

Commit 30221e7

Browse files
author
Алексей Тихомиров
committed
fix: check queue pause status before processing jobs
Worker::runNextJob() now checks WPQueue::isPaused() before attempting to process jobs from the queue.
1 parent 02169af commit 30221e7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Worker.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public function daemon(string $queue = 'default', int $sleep = 3): void
5151
*/
5252
public function runNextJob(string $queue = 'default'): bool
5353
{
54+
// Check if queue is paused
55+
if (WPQueue::isPaused($queue)) {
56+
return false;
57+
}
58+
5459
// Check if we should stop before processing
5560
if ($this->shouldStop()) {
5661
return false;

0 commit comments

Comments
 (0)