Check that feature database and table exists for gitaly features

This commit is contained in:
John Cai 2019-03-05 09:09:48 -08:00
parent 3fe2804cc2
commit 3a30dffd3e
1 changed files with 3 additions and 1 deletions

View File

@ -244,7 +244,9 @@ module Gitlab
end
def self.feature_enabled?(feature_name)
Feature.enabled?("gitaly_#{feature_name}")
Feature::FlipperFeature.table_exists? && Feature.enabled?("gitaly_#{feature_name}")
rescue ActiveRecord::NoDatabaseError
false
end
# Ensures that Gitaly is not being abuse through n+1 misuse etc