maintenance: remove hourly upload error checker.

This commit is contained in:
evazion
2019-12-23 00:14:38 -06:00
parent b650558633
commit ac9d06bf79
2 changed files with 0 additions and 24 deletions

View File

@@ -2,9 +2,6 @@ module DanbooruMaintenance
module_function
def hourly
UploadErrorChecker.new.check!
rescue Exception => exception
rescue_exception(exception)
end
def daily

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env ruby
require 'mail'
class UploadErrorChecker
def check!
uploads = Upload.where("status like 'error%' and status not like 'error: Upload::Error - Post with MD5%' and status not like 'error: ActiveRecord::RecordInvalid - Validation failed: Md5 duplicate%' and created_at >= ?", 1.hour.ago)
if uploads.size > 5
mail = Mail.new do
from Danbooru.config.contact_email
to Danbooru.config.contact_email
CurrentUser.as_system do
subject "[#{Danbooru.config.app_name}] Upload error count at #{uploads.size}"
end
body uploads.map {|x| x.status}.join("\n")
end
mail.delivery_method :sendmail
mail.deliver
end
end
end