mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
PERF: push reindex job to daily
This commit is contained in:
parent
20074a3140
commit
760e9a756d
@ -32,7 +32,6 @@ module Jobs
|
||||
Post.rebake_old(250)
|
||||
end
|
||||
|
||||
Search.rebuild_problem_posts
|
||||
end
|
||||
|
||||
end
|
||||
|
10
app/jobs/scheduled/reindex_search.rb
Normal file
10
app/jobs/scheduled/reindex_search.rb
Normal file
@ -0,0 +1,10 @@
|
||||
module Jobs
|
||||
# if locale changes or search algorithm changes we may want to reindex stuff
|
||||
class ReindexSearch < Jobs::Scheduled
|
||||
every 1.day
|
||||
|
||||
def execute(args)
|
||||
Search.rebuild_problem_posts
|
||||
end
|
||||
end
|
||||
end
|
@ -49,6 +49,7 @@ class Search
|
||||
)', SiteSetting.default_locale).limit(10000)
|
||||
|
||||
posts.each do |post|
|
||||
# force indexing
|
||||
post.cooked += " "
|
||||
SearchObserver.index(post)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user