Skip to content

Commit

Permalink
Add startup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Nov 22, 2024
1 parent e7560c1 commit 544640d
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 7 deletions.
19 changes: 16 additions & 3 deletions config/queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@ default: &default
- polling_interval: 1
batch_size: 500
workers:
- queues: "*"
threads: 3
processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %>
- queues:
- default
- mailers
- clock
- providers
- billing
- webhook
- invoices
- wallets
- integrations
threads: <%= ENV.fetch("JOB_CONCURRENCY", 10) %>
processes: 1
polling_interval: 0.1
- queues: "low_priority"
threads: <%= ENV.fetch("JOB_CONCURRENCY", 10) %>
processes: 1
polling_interval: 3

development:
<<: *default
Expand Down
18 changes: 18 additions & 0 deletions config/queue_events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
default: &default
dispatchers:
- polling_interval: 1
batch_size: 500
workers:
- queues: "events"
threads: 3
processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %>
polling_interval: 0.1

development:
<<: *default

test:
<<: *default

production:
<<: *default
18 changes: 18 additions & 0 deletions config/queue_pdfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
default: &default
dispatchers:
- polling_interval: 1
batch_size: 500
workers:
- queues: "pdfs"
threads: 3
processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %>
polling_interval: 3

development:
<<: *default

test:
<<: *default

production:
<<: *default
2 changes: 1 addition & 1 deletion scripts/start.events.worker.dev.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

bundle install
bundle exec sidekiq -C config/sidekiq_events.yml
bin/jobs -c config/queue_events.yml
2 changes: 1 addition & 1 deletion scripts/start.pdfs.worker.dev.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

bundle install
bundle exec sidekiq -C config/sidekiq_pdfs.yml
bin/jobs -c config/queue_pdfs.yml
3 changes: 1 addition & 2 deletions scripts/start.worker.dev.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

bundle install
#bundle exec sidekiq -C config/sidekiq.yml

bundle exec rake solid_queue:start
bin/jobs -c config/queue.yml

0 comments on commit 544640d

Please sign in to comment.