mirror of
https://github.com/chatwoot/chatwoot.git
synced 2026-06-04 21:02:35 +08:00
chore: remove logging from search service (#11112)
This commit is contained in:
parent
ff9545d03c
commit
a60dcda301
@ -35,16 +35,11 @@ class SearchService
|
||||
end
|
||||
|
||||
def filter_messages
|
||||
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||
|
||||
@messages = if use_gin_search
|
||||
filter_messages_with_gin
|
||||
else
|
||||
filter_messages_with_like
|
||||
end
|
||||
|
||||
log_search_performance(start_time)
|
||||
@messages
|
||||
end
|
||||
|
||||
def filter_messages_with_gin
|
||||
@ -85,14 +80,6 @@ class SearchService
|
||||
.where('created_at >= ?', 3.months.ago)
|
||||
end
|
||||
|
||||
def log_search_performance(start_time)
|
||||
end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||
search_type = use_gin_search ? 'GIN' : 'ILIKE'
|
||||
duration_ms = (end_time - start_time) * 1000
|
||||
|
||||
Rails.logger.info "[SearchService][#{current_account.id}] #{search_type} search query time: #{duration_ms}ms for #{search_query}"
|
||||
end
|
||||
|
||||
def use_gin_search
|
||||
current_account.feature_enabled?('search_with_gin')
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user