Commit e40f055f authored by Rémy Coutable's avatar Rémy Coutable Committed by Regis

Merge branch 'fix-ar-connection-leaks' into 'master'

Fix ActiveRecord connection leaks

Closes #27949 and gitlab-com/infrastructure#1139

See merge request !9109
parent 3e84053c
---
title: Don't connect in Gitlab::Database.adapter_name
merge_request:
author:
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
MAX_INT_VALUE = 2147483647 MAX_INT_VALUE = 2147483647
def self.adapter_name def self.adapter_name
connection.adapter_name ActiveRecord::Base.configurations[Rails.env]['adapter']
end end
def self.mysql? def self.mysql?
......
...@@ -5,6 +5,12 @@ class MigrationTest ...@@ -5,6 +5,12 @@ class MigrationTest
end end
describe Gitlab::Database, lib: true do describe Gitlab::Database, lib: true do
describe '.adapter_name' do
it 'returns the name of the adapter' do
expect(described_class.adapter_name).to be_an_instance_of(String)
end
end
# These are just simple smoke tests to check if the methods work (regardless # These are just simple smoke tests to check if the methods work (regardless
# of what they may return). # of what they may return).
describe '.mysql?' do describe '.mysql?' do
......
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