mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 19:17:48 +00:00 
			
		
		
		
	chore: remove logging from search service (#11112)
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Shivam Mishra
					Shivam Mishra