Commit aa0a1d0c authored by Mark Chao's avatar Mark Chao

Merge branch 'mmj-remove-ff-user_refresh_from_replica_worker_uses_replica_db' into 'master'

Run UserRefreshFromReplicaWorker jobs on the replica database (if available) by default

See merge request gitlab-org/gitlab!69728
parents cef871c1 22073894
...@@ -14,7 +14,6 @@ module AuthorizedProjectUpdate ...@@ -14,7 +14,6 @@ module AuthorizedProjectUpdate
deduplicate :until_executing, including_scheduled: true deduplicate :until_executing, including_scheduled: true
def perform(user_id) def perform(user_id)
if Feature.enabled?(:user_refresh_from_replica_worker_uses_replica_db)
use_replica_if_available do use_replica_if_available do
user = User.find_by_id(user_id) user = User.find_by_id(user_id)
...@@ -22,12 +21,6 @@ module AuthorizedProjectUpdate ...@@ -22,12 +21,6 @@ module AuthorizedProjectUpdate
enqueue_project_authorizations_refresh(user) enqueue_project_authorizations_refresh(user)
end end
end end
else
user = User.find_by_id(user_id)
return unless user
user.refresh_authorized_projects(source: self.class.name)
end
end end
private private
......
---
name: user_refresh_from_replica_worker_uses_replica_db
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64276
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334766
milestone: '14.1'
type: development
group: group::access
default_enabled: false
...@@ -51,20 +51,5 @@ RSpec.describe AuthorizedProjectUpdate::UserRefreshFromReplicaWorker do ...@@ -51,20 +51,5 @@ RSpec.describe AuthorizedProjectUpdate::UserRefreshFromReplicaWorker do
execute_worker execute_worker
end end
end end
context 'when the feature flag `user_refresh_from_replica_worker_uses_replica_db` is disabled' do
before do
stub_feature_flags(user_refresh_from_replica_worker_uses_replica_db: false)
end
it 'calls Users::RefreshAuthorizedProjectsService' do
source = 'AuthorizedProjectUpdate::UserRefreshFromReplicaWorker'
expect_next_instance_of(Users::RefreshAuthorizedProjectsService, user, { source: source }) do |service|
expect(service).to receive(:execute)
end
execute_worker
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