summaryrefslogtreecommitdiff
path: root/app/workers/mail_scheduler/notification_service_worker.rb
blob: 7cfe0aa0df1c9c96da4b8a5621c13580d773c94f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'active_job/arguments'

module MailScheduler
  class NotificationServiceWorker
    include ApplicationWorker
    include MailSchedulerQueue

    def perform(meth, *args)
      deserialized_args = ActiveJob::Arguments.deserialize(args)

      notification_service.public_send(meth, *deserialized_args) # rubocop:disable GitlabSecurity/PublicSend
    rescue ActiveJob::DeserializationError
    end

    def self.perform_async(*args)
      super(*ActiveJob::Arguments.serialize(args))
    end
  end
end