Commit fb697e69 authored by Yorick Peterse's avatar Yorick Peterse

Clear AR connections before starting Sidekiq

This should ensure that connections obtained before starting Sidekiq are
not leaked, leading to connection timeouts.

Fixes gitlab-com/infrastructure#1139
parent 7f2819b7
---
title: Clear ActiveRecord connections before starting Sidekiq
merge_request:
author:
......@@ -19,6 +19,12 @@ Sidekiq.configure_server do |config|
chain.add Gitlab::SidekiqStatus::ClientMiddleware
end
config.on :startup do
# Clear any connections that might have been obtained before starting
# Sidekiq (e.g. in an initializer).
ActiveRecord::Base.clear_all_connections!
end
# Sidekiq-cron: load recurring jobs from gitlab.yml
# UGLY Hack to get nested hash from settingslogic
cron_jobs = JSON.parse(Gitlab.config.cron_jobs.to_json)
......
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