]> cat aescling's git repositories - mastodon.git/commitdiff
We're going to want these nice helper methods, lets share them with a parent class...
authorKurtis Rainbolt-Greene <kurtis@rainbolt-greene.online>
Wed, 5 Apr 2017 04:14:37 +0000 (21:14 -0700)
committerKurtis Rainbolt-Greene <kurtis@rainbolt-greene.online>
Wed, 5 Apr 2017 04:14:37 +0000 (21:14 -0700)
app/workers/application_worker.rb [new file with mode: 0644]
app/workers/distribution_worker.rb

diff --git a/app/workers/application_worker.rb b/app/workers/application_worker.rb
new file mode 100644 (file)
index 0000000..f2d7c10
--- /dev/null
@@ -0,0 +1,5 @@
+class ApplicationWorker
+  def info(message)
+    Rails.logger.info("#{self.class.name} - #{message}")
+  end
+end
index f4e738d804d7f727b06bb97ac252944a0a388492..9a2867ea66f068c85cad4e03e0f45c13a93726f9 100644 (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