PERF: stop reindexing and skipping deleted posts

PERF: stop reindexing and skipping deleted posts

diff --git a/app/jobs/scheduled/reindex_search.rb b/app/jobs/scheduled/reindex_search.rb
index b941a22..50ed5e0 100644
--- a/app/jobs/scheduled/reindex_search.rb
+++ b/app/jobs/scheduled/reindex_search.rb
@@ -119,6 +119,7 @@ module Jobs
           AND pd.post_id = posts.id
         INNER JOIN topics ON topics.id = posts.topic_id
         WHERE pd.post_id IS NULL
+        AND posts.deleted_at IS NULL
         AND topics.deleted_at IS NULL
         AND posts.raw != ''
         ORDER BY posts.id DESC

GitHub sha: 22abad41

1 Like