forked from e621ng/e621ng
add hourly check for upload queue issues, restore old note coloring
This commit is contained in:
parent
10f40f4518
commit
47b88a1bb2
@ -5,7 +5,7 @@ div#note-container {
|
||||
div.note-body {
|
||||
position: absolute;
|
||||
border: 1px solid black;
|
||||
background: white;
|
||||
background: #FFE;
|
||||
min-width: 10px;
|
||||
min-height: 1em;
|
||||
line-height: normal;
|
||||
@ -48,7 +48,7 @@ div#note-container {
|
||||
|
||||
div.note-box-inner-border {
|
||||
border: 1px solid black;
|
||||
background: white;
|
||||
background: #FFE;
|
||||
}
|
||||
|
||||
div.note-box-inner-border.unsaved {
|
||||
|
20
app/logical/upload_error_checker.rb
Normal file
20
app/logical/upload_error_checker.rb
Normal 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
|
||||
|
4
config/monit.conf
Normal file
4
config/monit.conf
Normal file
@ -0,0 +1,4 @@
|
||||
set alert r888888888@gmail.com
|
||||
|
||||
check process delayed_job with pidfile /var/www/danbooru2/shared/pids/delayed_job.pid
|
||||
alert r888888888@gmail.com only on {nonexist}
|
@ -4,6 +4,10 @@ every 4.hours do
|
||||
runner "TagSubscription.process_all"
|
||||
end
|
||||
|
||||
every 1.hour do
|
||||
runner "UploadErrorChecker.new.check!"
|
||||
end
|
||||
|
||||
every 1.day do
|
||||
runner "PostPruner.new.prune!"
|
||||
end
|
||||
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
psql -hdbserver -c 'select count(*) from delayed_jobs' -Pt -A danbooru2 > /tmp/delayed_job_count
|
Loading…
Reference in New Issue
Block a user