performance tweaks for rails 4.1
This commit is contained in:
@@ -7,7 +7,7 @@ module PostSets
|
||||
def posts
|
||||
@posts ||= begin
|
||||
temp = ::Post.tag_match("#{tag_string} favcount:>3").paginate(page, :search_count => nil, :limit => 5)
|
||||
temp.all
|
||||
temp.each # hack to force rails to eager load
|
||||
temp
|
||||
end
|
||||
end
|
||||
|
||||
@@ -73,7 +73,7 @@ module PostSets
|
||||
else
|
||||
temp = ::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page)
|
||||
end
|
||||
temp.all
|
||||
temp.each # hack to force rails to eager load
|
||||
temp
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ require 'mail'
|
||||
|
||||
class UploadErrorChecker
|
||||
def check!
|
||||
uploads = Upload.where("status like 'error%' and status not like 'error: RuntimeError - duplicate%' and created_at >= ?", 1.hour.ago).all
|
||||
uploads = Upload.where("status like 'error%' and status not like 'error: RuntimeError - duplicate%' and created_at >= ?", 1.hour.ago)
|
||||
if uploads.size > 5
|
||||
mail = Mail.new do
|
||||
from "webmaster@danbooru.donmai.us"
|
||||
|
||||
Reference in New Issue
Block a user