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,19 +14,12 @@ module AuthorizedProjectUpdate
deduplicate :until_executing, including_scheduled: true
def perform(user_id)
if Feature.enabled?(:user_refresh_from_replica_worker_uses_replica_db)
use_replica_if_available do
user = User.find_by_id(user_id)
if user && project_authorizations_needs_refresh?(user)
enqueue_project_authorizations_refresh(user)
end
end
else
use_replica_if_available do
user = User.find_by_id(user_id)
return unless user
user.refresh_authorized_projects(source: self.class.name)
if user && project_authorizations_needs_refresh?(user)
enqueue_project_authorizations_refresh(user)
end
end
end
......
---
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
execute_worker
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
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