diff options
Diffstat (limited to 'app/services/members')
-rw-r--r-- | app/services/members/update_highest_role_service.rb | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/app/services/members/update_highest_role_service.rb b/app/services/members/update_highest_role_service.rb deleted file mode 100644 index 5ebd2e03df1..00000000000 --- a/app/services/members/update_highest_role_service.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -module Members - class UpdateHighestRoleService < ::BaseService - include ExclusiveLeaseGuard - - LEASE_TIMEOUT = 10.minutes.to_i - DELAY = 10.minutes - - attr_reader :user_id - - def initialize(user_id) - @user_id = user_id - end - - def execute - try_obtain_lease do - UpdateHighestRoleWorker.perform_in(DELAY, user_id) - end - end - - private - - def lease_key - "update_highest_role:#{user_id}" - end - - def lease_timeout - LEASE_TIMEOUT - end - - # Do not release the lease before the timeout to - # prevent multiple jobs being executed during the - # defined timeout - def lease_release? - false - end - end -end |