adapt original note resizing js code

This commit is contained in:
albert
2013-03-22 20:06:15 -04:00
parent 217e878a0f
commit 61b3a18ec7
3 changed files with 38 additions and 24 deletions

View File

@@ -4,13 +4,13 @@ require 'mail'
class UploadErrorChecker
def check!
count = Upload.where("status like 'error%' and created_at >= ?", 1.hour.ago).count
if count > 5
uploads = Upload.where("status like 'error%' and created_at >= ?", 1.hour.ago).all
if uploads.size > 5
mail = Mail.new do
from "webmaster@danbooru.donmai.us"
to "r888888888@gmail.com"
subject "[danbooru] Upload error count at #{count}"
body "nt"
subject "[danbooru] Upload error count at #{uploads.size}"
body uploads.map {|x| x.status}.join("\n")
end
mail.delivery_method :sendmail
mail.deliver