FIX: Turn off search logging when read-only (#7877)
If `SiteSetting.log_search_queries` is enabled 500 errors will occur when searching if the master db is down. This fix allows searching to still work under these conditions.
This commit is contained in:
parent
a49aa895d6
commit
c76732722a
|
@ -213,7 +213,7 @@ class Search
|
||||||
|
|
||||||
# Query a term
|
# Query a term
|
||||||
def execute
|
def execute
|
||||||
if SiteSetting.log_search_queries? && @opts[:search_type].present?
|
if SiteSetting.log_search_queries? && @opts[:search_type].present? && !Discourse.readonly_mode?
|
||||||
status, search_log_id = SearchLog.log(
|
status, search_log_id = SearchLog.log(
|
||||||
term: @term,
|
term: @term,
|
||||||
search_type: @opts[:search_type],
|
search_type: @opts[:search_type],
|
||||||
|
|
Loading…
Reference in New Issue