delayed jobs: drop failed jobs email alert.
Usually when jobs aren't working it's not because the jobs themselves are failing, it's because the workers crashed and aren't processing jobs at all.
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'mail'
|
||||
|
||||
class DelayedJobErrorChecker
|
||||
def check!
|
||||
errors = Delayed::Job.where("last_error is not null").limit(100).pluck(:last_error).map {|x| x[0..100]}
|
||||
if errors.size == 100
|
||||
mail = Mail.new do
|
||||
from Danbooru.config.contact_email
|
||||
to Danbooru.config.contact_email
|
||||
CurrentUser.as_system do
|
||||
subject "[#{Danbooru.config.app_name}] Delayed job error count at #{errors}"
|
||||
end
|
||||
body errors.uniq.join("\n")
|
||||
end
|
||||
mail.delivery_method :sendmail
|
||||
mail.deliver
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,6 @@ module Maintenance
|
||||
|
||||
def hourly
|
||||
UploadErrorChecker.new.check!
|
||||
DelayedJobErrorChecker.new.check!
|
||||
rescue Exception => exception
|
||||
rescue_exception(exception)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user