Merge branch 'rails5-fix-db-check' into 'master'
Rails5 fix db check: connection execute returns integer instead of string See merge request gitlab-org/gitlab-ce!19901
This commit is contained in:
commit
7849fd3695
2 changed files with 6 additions and 1 deletions
5
changelogs/unreleased/rails5-fix-db-check.yml
Normal file
5
changelogs/unreleased/rails5-fix-db-check.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Rails5 fix connection execute return integer instead of string
|
||||||
|
merge_request: 19901
|
||||||
|
author: Jasper Maes
|
||||||
|
type: fixed
|
|
@ -17,7 +17,7 @@ module Gitlab
|
||||||
def check
|
def check
|
||||||
catch_timeout 10.seconds do
|
catch_timeout 10.seconds do
|
||||||
if Gitlab::Database.postgresql?
|
if Gitlab::Database.postgresql?
|
||||||
ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.[]('ping')
|
ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.[]('ping')&.to_s
|
||||||
else
|
else
|
||||||
ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.first&.to_s
|
ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.first&.to_s
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue