diff options
author | Kurtis Rainbolt-Greene <kurtis@rainbolt-greene.online> | 2017-04-04 21:14:37 -0700 |
---|---|---|
committer | Kurtis Rainbolt-Greene <kurtis@rainbolt-greene.online> | 2017-04-04 21:14:37 -0700 |
commit | 22dcadedb495d2e1279b834a624710d34daee6ad (patch) | |
tree | 00bc6dbbafd626ace87fe8d653249100e32173ef | |
parent | ccb6a658fd1a2e596c95d5b8e7a39f72a5f5b14b (diff) |
We're going to want these nice helper methods, lets share them with a parent class that matches Rails 5 practices (application level abstraction)
-rw-r--r-- | app/workers/application_worker.rb | 5 | ||||
-rw-r--r-- | app/workers/distribution_worker.rb | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/workers/application_worker.rb b/app/workers/application_worker.rb new file mode 100644 index 000000000..f2d7c1062 --- /dev/null +++ b/app/workers/application_worker.rb @@ -0,0 +1,5 @@ +class ApplicationWorker + def info(message) + Rails.logger.info("#{self.class.name} - #{message}") + end +end diff --git a/app/workers/distribution_worker.rb b/app/workers/distribution_worker.rb index f4e738d80..9a2867ea6 100644 --- a/app/workers/distribution_worker.rb +++ b/app/workers/distribution_worker.rb @@ -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 |