Commit 153ec569 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'if-waitable_worker_inline_log' into 'master'

Log WaitableWorker inline job executions

See merge request gitlab-org/gitlab!63997
parents ba2496c6 91ec5362
......@@ -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