chore: remove logging from search service (#11112)

This commit is contained in:
Shivam Mishra
2025-03-19 19:10:25 +05:30
committed by GitHub
parent ff9545d03c
commit a60dcda301

View File

@@ -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