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:
evazion
2019-08-10 12:06:23 -05:00
parent 072885bbf8
commit 96b28a77e7
2 changed files with 0 additions and 23 deletions

View File

@@ -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

View File

@@ -3,7 +3,6 @@ module Maintenance
def hourly
UploadErrorChecker.new.check!
DelayedJobErrorChecker.new.check!
rescue Exception => exception
rescue_exception(exception)
end