refactor: Add conditional check before setting cache in Graph class

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-21 13:16:34 -03:00
commit 137e82f5a4

View file

@ -292,7 +292,8 @@ class Graph:
# Process the graph
try:
cache_service = get_chat_service()
await cache_service.set_cache(self.flow_id, self)
if self.flow_id:
await cache_service.set_cache(self.flow_id, self)
except Exception as exc:
logger.exception(exc)