use read only databse for tag subscription processing
This commit is contained in:
@@ -67,7 +67,7 @@ class TagSubscription < ActiveRecord::Base
|
|||||||
def process
|
def process
|
||||||
divisor = [tag_query_array.size / 2, 1].max
|
divisor = [tag_query_array.size / 2, 1].max
|
||||||
post_ids = tag_query_array.inject([]) do |all, query|
|
post_ids = tag_query_array.inject([]) do |all, query|
|
||||||
all += Post.tag_match(query).limit(Danbooru.config.tag_subscription_post_limit / divisor).select("posts.id").order("posts.id DESC").map(&:id)
|
all += PostReadOnly.tag_match(query).limit(Danbooru.config.tag_subscription_post_limit / divisor).select("posts.id").order("posts.id DESC").map(&:id)
|
||||||
end
|
end
|
||||||
self.post_ids = post_ids.sort.reverse.slice(0, Danbooru.config.tag_subscription_post_limit).join(",")
|
self.post_ids = post_ids.sort.reverse.slice(0, Danbooru.config.tag_subscription_post_limit).join(",")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user