Class: SyncMachine::EnsurePublicationWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/sync_machine/ensure_publication_worker.rb

Overview

Call EnsurePublication service via a Sidekiq job.

Defined Under Namespace

Classes: Hook

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inherited(subclass) ⇒ Object



17
18
19
# File 'lib/sync_machine/ensure_publication_worker.rb', line 17

def self.inherited(subclass)
  subclass.hooks = {}
end

Instance Method Details

#perform(subject_id, enqueue_time_str) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/sync_machine/ensure_publication_worker.rb', line 21

def perform(subject_id, enqueue_time_str)
  subject = find_subject(subject_id)
  EnsurePublication.new(
    enqueue_time_str: enqueue_time_str,
    hooks: self.class.hooks,
    subject: subject,
    sync_module: SyncMachine.sync_module(self.class)
  ).run
end