summaryrefslogtreecommitdiff
path: root/app/workers/authorized_project_update/user_refresh_over_user_range_worker.rb
blob: 336b1c5443e7a0771093eb4cd9104a927e212f0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module AuthorizedProjectUpdate
  class UserRefreshOverUserRangeWorker
    include ApplicationWorker

    feature_category :authentication_and_authorization
    urgency :low
    queue_namespace :authorized_project_update
    deduplicate :until_executing, including_scheduled: true

    idempotent!

    def perform(start_user_id, end_user_id)
      if ::Feature.enabled?(:periodic_project_authorization_recalculation, default_enabled: true)
        AuthorizedProjectUpdate::RecalculateForUserRangeService.new(start_user_id, end_user_id).execute
      end
    end
  end
end