Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
use ENV variables to configure worker queues
Browse files Browse the repository at this point in the history
Attempting to use the --queues flag didn't work, but using the ENV
variable does
  • Loading branch information
bkiahstroud committed Feb 21, 2024
1 parent d984f6d commit c8fbed6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions bin/worker
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ else
end

if ENV['AUX_WORKER']
exec "echo $DATABASE_URL && bundle exec good_job --queues='*'"
# Run all queues (including :auxiliary)
exec "export GOOD_JOB_QUEUES='*'"
exec "echo $DATABASE_URL && bundle exec good_job"
else
exec "echo $DATABASE_URL && bundle exec good_job --queues='-auxiliary'"
# Run all queues (excluding :auxiliary)
exec "export GOOD_JOB_QUEUES='-auxiliary'"
exec "echo $DATABASE_URL && bundle exec good_job"
end
3 changes: 2 additions & 1 deletion ops/dev-deploy.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,13 @@ worker:
fsGroup: 101
fsGroupChangePolicy: "OnRootMismatch"
extraVolumeMounts: *volMounts
extraEnvVars: *envVars
extraEnvVars: *envVars # GOOD_JOB_QUEUES gets set in bin/worker

# When adding/removing key-value pairs to this block, ensure the
# corresponding changes are made in the `extraDeploy` block below.
workerAuxiliary:
extraEnvVars:
# GOOD_JOB_QUEUES gets set in bin/worker
- name: AUX_WORKER
value: "true"

Expand Down

0 comments on commit c8fbed6

Please sign in to comment.