Post#tag_match: clean up read_only param.

* Drop /posts?ro=true param (broken).
* Clean up tag_match (rescuing PG::ConnectionBad didn't do anything, we
  just build the query here, we don't run it).
This commit is contained in:
evazion
2019-08-16 00:26:00 -05:00
parent bb157f5d5b
commit 798d524e60
4 changed files with 6 additions and 20 deletions

View File

@@ -97,7 +97,7 @@ class SavedSearch < ApplicationRecord
CurrentUser.as_system do
redis_key = "search:#{query}"
return if redis.exists(redis_key)
post_ids = Post.tag_match(query, true).limit(QUERY_LIMIT).pluck(:id)
post_ids = Post.tag_match(query, read_only: true).limit(QUERY_LIMIT).pluck(:id)
redis.sadd(redis_key, post_ids)
redis.expire(redis_key, REDIS_EXPIRY)
end