Class: MailScheduler::NotificationServiceWorker
- Inherits:
-
Object
- Object
- MailScheduler::NotificationServiceWorker
- Includes:
- ApplicationWorker, MailSchedulerQueue
- Defined in:
- app/workers/mail_scheduler/notification_service_worker.rb
Overview
rubocop:disable Scalability/IdempotentWorker
Constant Summary
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Class Method Summary collapse
Instance Method Summary collapse
Methods included from MailSchedulerQueue
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Class Method Details
.perform_async(*args) ⇒ Object
37 38 39 |
# File 'app/workers/mail_scheduler/notification_service_worker.rb', line 37 def self.perform_async(*args) super(*ActiveJob::Arguments.serialize(args)) end |
Instance Method Details
#perform(meth, *args) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/workers/mail_scheduler/notification_service_worker.rb', line 18 def perform(meth, *args) check_arguments!(args) if NotificationService.permitted_actions.exclude?(meth.to_sym) raise(ArgumentError, "#{meth} not allowed for #{self.class.name}") end deserialized_args = ActiveJob::Arguments.deserialize(args) notification_service.public_send(meth, *deserialized_args) # rubocop:disable GitlabSecurity/PublicSend rescue ActiveJob::DeserializationError # No-op. # This exception gets raised when an argument # is correct (deserializeable), but it still cannot be deserialized. # This can happen when an object has been deleted after # rails passes this job to sidekiq, but before # sidekiq gets it for execution. # In this case just do nothing. end |