Commit a033faa2 authored by Stan Hu's avatar Stan Hu

Merge branch 'dm-batch-loader-sidekiq' into 'master'

Clear BatchLoader context between Sidekiq jobs

Closes #53079

See merge request gitlab-org/gitlab-ce!23308
parents 0a42c7cb 1b8a7918
---
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