Browse Source

Merge pull request #908 from krainboltgreene/application-worker-for-shared-logic

ApplicationWorker for shared worker behavior
closed-social-v3
Eugen 7 years ago
committed by GitHub
parent
commit
6b566c6b88
2 changed files with 7 additions and 2 deletions
  1. +5
    -0
      app/workers/application_worker.rb
  2. +2
    -2
      app/workers/distribution_worker.rb

+ 5
- 0
app/workers/application_worker.rb View File

@ -0,0 +1,5 @@
class ApplicationWorker
def info(message)
Rails.logger.info("#{self.class.name} - #{message}")
end
end

+ 2
- 2
app/workers/distribution_worker.rb View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
class DistributionWorker
class DistributionWorker < ApplicationWorker
include Sidekiq::Worker
def perform(status_id)
@ -9,6 +9,6 @@ class DistributionWorker
FanOutOnWriteService.new.call(status)
WarmCacheService.new.call(status)
rescue ActiveRecord::RecordNotFound
true
info("Couldn't find the status")
end
end

Loading…
Cancel
Save