Commit 91ec5362 authored by Imre Farkas's avatar Imre Farkas

Log WaitableWorker inline job executions

Sidekiq does not log these executions as they are not performed async.

Changelog: other
parent 494fa3af
......@@ -32,7 +32,9 @@ module WaitableWorker
failed = []
args_list.each do |args|
new.perform(*args)
worker = new
Gitlab::AppJsonLogger.info(worker.structured_payload(message: 'running inline'))
worker.perform(*args)
rescue StandardError
failed << args
end
......
......@@ -38,6 +38,12 @@ RSpec.describe WaitableWorker do
it 'inlines workloads <= 3 jobs' do
args_list = [[1], [2], [3]]
expect(worker).to receive(:bulk_perform_inline).with(args_list).and_call_original
expect(Gitlab::AppJsonLogger).to(
receive(:info).with(a_hash_including('message' => 'running inline',
'class' => 'Gitlab::Foo::Bar::DummyWorker',
'job_status' => 'running',
'queue' => 'foo_bar_dummy'))
.exactly(3).times)
worker.bulk_perform_and_wait(args_list)
......
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