summaryrefslogtreecommitdiff
path: root/lib/gitlab/sidekiq_config/worker_matcher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/sidekiq_config/worker_matcher.rb')
-rw-r--r--lib/gitlab/sidekiq_config/worker_matcher.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/sidekiq_config/worker_matcher.rb b/lib/gitlab/sidekiq_config/worker_matcher.rb
index fe5ac10c65a..d615d5ecba4 100644
--- a/lib/gitlab/sidekiq_config/worker_matcher.rb
+++ b/lib/gitlab/sidekiq_config/worker_matcher.rb
@@ -10,6 +10,7 @@ module Gitlab
QUERY_TERM_REGEX = %r{^(\w+)(!?=)([\w:#{QUERY_CONCATENATE_OPERATOR}]+)}.freeze
QUERY_PREDICATES = {
+ worker_name: :to_s,
feature_category: :to_sym,
has_external_dependencies: lambda { |value| value == 'true' },
name: :to_s,
@@ -50,7 +51,7 @@ module Gitlab
def predicate_for_term(term)
match = term.match(QUERY_TERM_REGEX)
- raise InvalidTerm.new("Invalid term: #{term}") unless match
+ raise InvalidTerm, "Invalid term: #{term}" unless match
_, lhs, op, rhs = *match
@@ -66,14 +67,14 @@ module Gitlab
else
# This is unreachable because InvalidTerm will be raised instead, but
# keeping it allows to guard against that changing in future.
- raise UnknownOperator.new("Unknown operator: #{op}")
+ raise UnknownOperator, "Unknown operator: #{op}"
end
end
def predicate_factory(lhs, values)
values_block = QUERY_PREDICATES[lhs.to_sym]
- raise UnknownPredicate.new("Unknown predicate: #{lhs}") unless values_block
+ raise UnknownPredicate, "Unknown predicate: #{lhs}" unless values_block
lambda do |queue|
comparator = Array(queue[lhs.to_sym]).to_set