Skip to content

Fix retry log time and back off while idle - #28

Merged
hellopablo merged 2 commits into
developfrom
fix/worker-retry-log-and-idle-backoff
Nov 2, 2026
Merged

hellopablo merged 2 commits into
developfrom
fix/worker-retry-log-and-idle-backoff

Conversation

@hellopablo

Copy link
Copy Markdown
Member

What

  • RETRY log line: it printed the job's old available_at, because the worker discarded the job returned by retryJob(). It now prints the new due time.
  • Idle backoff: an idle worker slept for a fixed QUEUE_WORKER_WAIT_TIME. It now doubles the wait on each empty poll, up to 5000ms (Work::MAX_WAIT_TIME), and starts again after a job. This is what the README described.
  • README: shortened to a summary that links to the new documentation. It also states that the built-in priority queue needs a worker process of its own.

Behaviour change

A job pushed to an idle worker can now wait up to about five seconds before it is picked up, where before it waited about half a second. Set QUEUE_WORKER_WAIT_TIME higher than 5000 to raise the cap, or revert the second hunk in Work.php to keep a fixed poll.

Testing

php -l passes. The change is in the worker loop, which needs a database, so it has not been run against a live worker. phpunit and phpstan report the same two errors on develop as on this branch (Nails\FindReplace\Interfaces\Exclusion not found, from a stale vendor copy of module-find-replace).

Documentation: nails/docs, branch feature/queue-docs. The backoff behaviour is described there, so the two should merge together.

🤖 Generated with Claude Code

hellopablo and others added 2 commits November 2, 2026 20:53
The RETRY line printed the job's old available_at, because the worker
discarded the job returned by retryJob(). It now prints the new due time.

An idle worker slept for a fixed QUEUE_WORKER_WAIT_TIME. It now doubles
the wait on each empty poll, up to 5000ms, and starts again after a job,
as the README described.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The full reference now lives in the docs repo. The README is a summary,
and states that the priority queue needs a worker process of its own.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@hellopablo
hellopablo force-pushed the fix/worker-retry-log-and-idle-backoff branch from 98fd5a4 to 77070bb Compare November 2, 2026 20:53
@hellopablo
hellopablo merged commit 7ba8c7c into develop Nov 2, 2026
5 checks passed
@hellopablo
hellopablo deleted the fix/worker-retry-log-and-idle-backoff branch November 2, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant