add hourly check for upload queue issues, restore old note coloring

This commit is contained in:
albert
2013-03-12 15:49:58 -04:00
parent 10f40f4518
commit 47b88a1bb2
5 changed files with 30 additions and 5 deletions

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env ruby
require 'mail'
class UploadErrorChecker
def check!
count = Upload.where("status like 'error%' and created_at >= ?", 1.hour.ago).count
if count > 5
mail = Mail.new do
from "webmaster@danbooru.donmai.us"
to "r888888888@gmail.com"
subject "[danbooru] Upload error count at #{count}"
body "nt"
end
mail.delivery_method :sendmail
mail.deliver
end
end
end