Commit 1b8a7918 authored by Douwe Maan's avatar Douwe Maan Committed by Stan Hu

Clear BatchLoader context between Sidekiq jobs

parent ba9eeea4
---
title: Clear BatchLoader context between Sidekiq jobs
merge_request: 23308
author:
type: fixed
......@@ -20,6 +20,7 @@ Sidekiq.configure_server do |config|
chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger if ENV['SIDEKIQ_LOG_ARGUMENTS'] && !enable_json_logs
chain.add Gitlab::SidekiqMiddleware::Shutdown
chain.add Gitlab::SidekiqMiddleware::RequestStoreMiddleware unless ENV['SIDEKIQ_REQUEST_STORE'] == '0'
chain.add Gitlab::SidekiqMiddleware::BatchLoader
chain.add Gitlab::SidekiqStatus::ServerMiddleware
end
......
# frozen_string_literal: true
module Gitlab
module SidekiqMiddleware
class BatchLoader
def call(worker, job, queue)
yield
ensure
::BatchLoader::Executor.clear_current
end
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