Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/database/load_balancing/host.rb')
-rw-r--r--lib/gitlab/database/load_balancing/host.rb19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/gitlab/database/load_balancing/host.rb b/lib/gitlab/database/load_balancing/host.rb
index acd7df0a263..bdbb80d6f31 100644
--- a/lib/gitlab/database/load_balancing/host.rb
+++ b/lib/gitlab/database/load_balancing/host.rb
@@ -9,19 +9,12 @@ module Gitlab
delegate :connection, :release_connection, :enable_query_cache!, :disable_query_cache!, :query_cache_enabled, to: :pool
- CONNECTION_ERRORS =
- if defined?(PG)
- [
- ActionView::Template::Error,
- ActiveRecord::StatementInvalid,
- PG::Error
- ].freeze
- else
- [
- ActionView::Template::Error,
- ActiveRecord::StatementInvalid
- ].freeze
- end
+ CONNECTION_ERRORS = [
+ ActionView::Template::Error,
+ ActiveRecord::StatementInvalid,
+ ActiveRecord::ConnectionNotEstablished,
+ PG::Error
+ ].freeze
# host - The address of the database.
# load_balancer - The LoadBalancer that manages this Host.