From a622041696ccc09447a6d78ee81b7c7497d78815 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 30 Jun 2023 12:26:53 +0530 Subject: [PATCH] feat: save to cache only if response is present --- lib/integrations/openai_processor_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/integrations/openai_processor_service.rb b/lib/integrations/openai_processor_service.rb index d80f66849..a9ad59c7b 100644 --- a/lib/integrations/openai_processor_service.rb +++ b/lib/integrations/openai_processor_service.rb @@ -18,7 +18,7 @@ class Integrations::OpenaiProcessorService return value_from_cache if CACHEABLE_EVENTS.include?(event_name) && value_from_cache.present? response = send("#{event_name}_message") - save_to_cache(response) if CACHEABLE_EVENTS.include?(event_name) + save_to_cache(response) if CACHEABLE_EVENTS.include?(event_name) && response.present? response end