debian-mirror-gitlab/app/workers/disallow_two_factor_for_group_worker.rb

25 lines
461 B
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
class DisallowTwoFactorForGroupWorker
include ApplicationWorker
2021-06-08 01:23:25 +05:30
2021-10-27 15:23:28 +05:30
data_consistency :always
2021-06-08 01:23:25 +05:30
sidekiq_options retry: 3
2021-01-03 14:25:43 +05:30
include ExceptionBacktrace
feature_category :subgroups
2021-06-08 01:23:25 +05:30
tags :exclude_from_kubernetes
2021-01-03 14:25:43 +05:30
idempotent!
def perform(group_id)
begin
group = Group.find(group_id)
rescue ActiveRecord::RecordNotFound
return
end
group.update!(require_two_factor_authentication: false)
end
end