Class: MembersDestroyer::UnassignIssuablesWorker
- Inherits:
-
Object
- Object
- MembersDestroyer::UnassignIssuablesWorker
- Includes:
- ApplicationWorker
- Defined in:
- app/workers/members_destroyer/unassign_issuables_worker.rb
Constant Summary collapse
- ENTITY_TYPES =
%w[Group Project].freeze
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_CONCURRENCY_LIMIT_PERCENTAGE_BY_URGENCY, WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DATA_CONSISTENCY_PER_DB, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::LOAD_BALANCED_DATA_CONSISTENCIES, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Instance Method Summary collapse
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#perform(user_id, entity_id, entity_type, requesting_user_id) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/workers/members_destroyer/unassign_issuables_worker.rb', line 18 def perform(user_id, entity_id, entity_type, requesting_user_id) unless ENTITY_TYPES.include?(entity_type) logger.error( message: "#{entity_type} is not a supported entity.", entity_type: entity_type, entity_id: entity_id, user_id: user_id, requesting_user_id: requesting_user_id ) return end if requesting_user_id.nil? logger.error( message: "requesting_user_id is nil.", entity_type: entity_type, entity_id: entity_id, user_id: user_id, requesting_user_id: requesting_user_id ) return end requesting_user = User.find(requesting_user_id) user = User.find(user_id) entity = entity_type.constantize.find(entity_id) ::Members::UnassignIssuablesService.new(user, entity, requesting_user).execute end |