Commit 9a13e3ee authored by Thong Kuah's avatar Thong Kuah

Log when primary host for DB load balancing is marked offline

Changelog: changed
parent c9eb99bd
......@@ -49,6 +49,11 @@ module Gitlab
end
def offline!
::Gitlab::Database::LoadBalancing::Logger.warn(
event: :host_offline,
message: 'Marking primary host as offline'
)
nil
end
......
......@@ -51,7 +51,11 @@ RSpec.describe Gitlab::Database::LoadBalancing::PrimaryHost do
end
describe '#offline!' do
it 'does nothing' do
it 'logs the event but does nothing else' do
expect(Gitlab::Database::LoadBalancing::Logger).to receive(:warn)
.with(hash_including(event: :host_offline))
.and_call_original
expect(host.offline!).to be_nil
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