Commit f8e1e57f authored by Nick Thomas's avatar Nick Thomas

Merge branch 'sh-fix-streaming-health-check' into 'master'

Fix Geo streaming check

Closes #4765

See merge request gitlab-org/gitlab-ee!4340
parents 7d266369 f746c85b
...@@ -80,13 +80,12 @@ module Gitlab ...@@ -80,13 +80,12 @@ module Gitlab
def self.streaming_active? def self.streaming_active?
# Get a streaming status # Get a streaming status
# This only works for Postgresql 9.6 and greater # This only works for Postgresql 9.6 and greater
status = pid =
ActiveRecord::Base.connection.execute(' ActiveRecord::Base.connection.select_values('
SELECT * FROM pg_stat_wal_receiver;') SELECT pid FROM pg_stat_wal_receiver;')
.first .first
.fetch('status')
status == 'streaming' pid.to_i > 0
end end
end end
end end
......
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