add script for vacuuming

This commit is contained in:
r888888888
2017-11-15 18:56:19 -08:00
parent 351dbb4137
commit 5f004b6138
2 changed files with 16 additions and 0 deletions

View File

@@ -58,6 +58,9 @@ module DelayedJobsHelper
when "Post.delete_files"
"<strong>delete old files</strong>"
when "BulkRevert#process"
"<strong>bulk revert</strong>"
else
h(job.name)
end
@@ -119,6 +122,9 @@ module DelayedJobsHelper
when "Post.delete_files"
%{<a href="/posts/#{job.payload_object.args.first}">post ##{job.payload_object.args.first}</a>}
when "BulkRevert#process"
h(job.payload_object.args.join(" "))
else
h(job.handler)
end

10
script/donmai/vacuum.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
psql -h dbserver <<EOF
set statement_timeout = 0;
vacuum analyze posts;
vacuum analyze tags;
vacuum analyze users;
vacuum analyze favorites;
vacuum analyze comments;
EOF