Commit 11a03556 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ajk-admin-sidekiq-queues-minor-refactor' into 'master'

Improve argument handling

See merge request gitlab-org/gitlab!47244
parents 469b846a 83fd3f5c
......@@ -33,9 +33,9 @@ module Mutations
super
end
def resolve(args)
def resolve(queue_name:, **args)
{
result: Gitlab::SidekiqQueue.new(args[:queue_name]).drop_jobs!(args, timeout: 30),
result: Gitlab::SidekiqQueue.new(queue_name).drop_jobs!(args, timeout: 30),
errors: []
}
rescue Gitlab::SidekiqQueue::NoMetadataError
......@@ -44,7 +44,7 @@ module Mutations
errors: ['No metadata provided']
}
rescue Gitlab::SidekiqQueue::InvalidQueueError
raise Gitlab::Graphql::Errors::ResourceNotAvailable, "Queue #{args[:queue_name]} not found"
raise Gitlab::Graphql::Errors::ResourceNotAvailable, "Queue #{queue_name} not found"
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment