Skip to content

Conversation

@lovro-bikic
Copy link

The readme states that SOLID_QUEUE_SUPERVISOR_MODE environment variable can be used to control supervisor mode. However, this isn't the case currently. When I run:

SOLID_QUEUE_SUPERVISOR_MODE=async bin/jobs

Solid Queue is still started in fork mode.

This is because Cli class sets the default value for --mode option to fork:

class_option :mode, type: :string, default: "fork", enum: %w[ fork async ],

so when Configuration is instantiated:
def initialize(**options)
@options = options.with_defaults(default_options)

options will always contain { mode: "fork" }, so default_options, which reads the SOLID_QUEUE_SUPERVISOR_MODE env variable, never applies:
def default_options
{
mode: ENV["SOLID_QUEUE_SUPERVISOR_MODE"] || :fork,

This PR removes the default value from Cli class so that default_options can apply.

I didn't add any tests, but let me know if (and where) I should.

Setting a default value will override the defaults in Configuration, which reads from the SOLID_QUEUE_SUPERVISOR_MODE environment variable, effectively making it useless
@lovro-bikic lovro-bikic changed the title Remove default value for 'mode' in CLI options Remove default value for mode in CLI options Jan 29, 2026
@lovro-bikic lovro-bikic changed the title Remove default value for mode in CLI options Fix SOLID_QUEUE_SUPERVISOR_MODE environment variable Jan 29, 2026
@lovro-bikic lovro-bikic changed the title Fix SOLID_QUEUE_SUPERVISOR_MODE environment variable Fix application of SOLID_QUEUE_SUPERVISOR_MODE environment variable Jan 29, 2026
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