2016-01-27 10:59:16 -05:00
|
|
|
class NewNoteWorker
|
|
|
|
include Sidekiq::Worker
|
2016-10-21 12:13:41 -04:00
|
|
|
include DedicatedSidekiqQueue
|
2016-01-27 10:59:16 -05:00
|
|
|
|
2016-10-13 11:26:44 -04:00
|
|
|
def perform(note_id)
|
|
|
|
if note = Note.find_by(id: note_id)
|
|
|
|
NotificationService.new.new_note(note)
|
|
|
|
Notes::PostProcessService.new(note).execute
|
|
|
|
else
|
|
|
|
Rails.logger.error("NewNoteWorker: couldn't find note with ID=#{note_id}, skipping job")
|
|
|
|
end
|
2016-01-27 10:59:16 -05:00
|
|
|
end
|
|
|
|
end
|