Skip to content

Implementing a single-worker queue module in a load-balanced environment #12337

Closed Answered by brandonkelly
aaronbushnell asked this question in Q&A
Discussion options

You must be logged in to vote

getHasReservedJobs() can be a little unreliable if a job resulted in a fatal error (e.g. a resource limit was exceeded).

Instead I’ve added support for a new --isolated option to all CLI commands for Craft 4.4 (#12350), which can be passed to ensure the command is only run once at a time. Any duplicate runs will be aborted with The <command name> command is already running. output to stderr and exit code 1.

Couple examples:

php craft up --isolated
php craft queue/listen --verbose --isolated
php craft gc --isolated

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
4 replies
@aaronbushnell
Comment options

@brandonkelly
Comment options

@aaronbushnell
Comment options

@brandonkelly
Comment options

Answer selected by brandonkelly
Comment options

You must be logged in to vote
4 replies
@brandonkelly
Comment options

@aaronbushnell
Comment options

@brandonkelly
Comment options

@aaronbushnell
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants