summaryrefslogtreecommitdiff
path: root/app/workers/mail_scheduler/notification_service_worker.rb
blob: 4726e4161824f80a556e8e654d10a15e7647e383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

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