• Sean McGivern's avatar
    Always use generated queue name for worker matching · 294b5d42
    Sean McGivern authored
    When we match against workers, the `name` attribute is tricky. It means
    the queue name, but which queue name?
    
    1. The actual queue name (after applying worker routing rules)?
    2. The generated queue name (based on the worker class name and queue
       namespace)?
    
    Before this commit, it was 1, but that was confusing: it would start as
    `default` (before the attribute was set), then change to the generated
    queue name, then change again to the queue name based on worker routing
    rules. Because the routing rules are evaluated on application load, this
    was hard to debug and could give unexpected results.
    
    Instead, we say that the `name` attribute always means item 2. This is
    also the name present in `all_queues.yml`, and this file is referenced
    in the documentation. That means it's more consistent and predictable,
    and doesn't require changes to the router itself.
    294b5d42
every_sidekiq_worker_spec.rb 22.6 KB