Commit fc2b346c authored by Stan Hu's avatar Stan Hu

Fix return value when Geo nodes are not in sync

Relates to #2469
parent 3d4fc3dd
...@@ -42,6 +42,7 @@ module Gitlab ...@@ -42,6 +42,7 @@ module Gitlab
data data
rescue JWT::DecodeError => e rescue JWT::DecodeError => e
Rails.logger.error("Error decoding Geo request: #{e}") Rails.logger.error("Error decoding Geo request: #{e}")
return
end end
end end
......
...@@ -26,5 +26,11 @@ describe Gitlab::Geo::JwtRequestDecoder do ...@@ -26,5 +26,11 @@ describe Gitlab::Geo::JwtRequestDecoder do
primary_node.save primary_node.save
expect(described_class.new(data).decode).to be_nil expect(described_class.new(data).decode).to be_nil
end end
it 'returns nil when clocks are not in sync' do
allow(JWT).to receive(:decode).and_raise(JWT::InvalidIatError)
expect(subject.decode).to be_nil
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