Commit a1a8e297 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch '1243-fix-cloning-from-geo-secondary' into 'master'

Geo: fix a problem that prevented git cloning from secondary node

This MR prevents activity_service writing in secondary Geo (#76) node's database. This will fix the failure users were experiencing when trying to `git clone` from the secondary node.

cc @marin @dewetblomerus @patricio 

Closes #1243 

See merge request !873
parents fe55de83 91c55996
......@@ -14,7 +14,7 @@ module Users
private
def record_activity
user_activity.touch
user_activity.touch unless Gitlab::Geo.secondary?
Rails.logger.debug("Recorded activity: #{@activity} for User ID: #{@author.id} (username: #{@author.username}")
end
......
---
title: 'Geo: fix a problem that prevented git cloning from secondary node'
merge_request: 873
author:
......@@ -22,5 +22,13 @@ describe Users::ActivityService, services: true do
end
end
end
context 'when in Geo secondary node' do
before { allow(Gitlab::Geo).to receive(:secondary?).and_return(true) }
it 'does not update last_activity_at' do
expect { service.execute }.not_to change { user.reload.last_activity_at }
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