feat: save to cache only if response is present

This commit is contained in:
Shivam Mishra
2023-06-30 12:26:53 +05:30
parent 18245dd757
commit a622041696
+1 -1
View File
@@ -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