提交 1b8a7918 编写于 作者: D Douwe Maan 提交者: Stan Hu

Clear BatchLoader context between Sidekiq jobs

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册