rails / solid_queue

Database-backed Active Job backend
MIT License
1.95k stars 130 forks source link

Is there a way to exclude queues for workers? #392

Closed salmonsteak1 closed 3 weeks ago

salmonsteak1 commented 4 weeks ago

Hey, I'm looking to segregate my workers for specific jobs so that long running jobs wouldn't hog up my main set of workers working on the '*' queue. Is that possible? Currently it seems like what I've defined below would cause the set of workers defined with '*' to work on SpecificLongRunningJob too:

default: &default
  dispatchers:
    - polling_interval: 1
      batch_size: 500
  workers:
    - queues: '*'
      threads: 1
      processes: 3
      polling_interval: 0.1
    - queues: 'SpecificLongRunningJob'
      threads: 1
      processes: 3
      polling_interval: 0.1

development:
  <<: *default

test:
  <<: *default

production:
  <<: *default
rosa commented 3 weeks ago

Yes, that's right. There's no way to exclude queues from workers. * means all queues, including SpecificLongRunningJob. You'd have to explicitly list all queues except for SpecificLongRunningJob to achieve that result.