🐛 fix(manager.py): add cache_manager.set() to store langchain_object in cache after successful initialization
🐛 fix(celeryconfig.py): fix condition to check if BROKER_URL and RESULT_BACKEND are present in os.environ before using them, fallback to langflow_redis_host and langflow_redis_port if not present
This commit is contained in:
parent
682e611947
commit
2183f167cd
2 changed files with 5 additions and 4 deletions
|
|
@ -135,6 +135,7 @@ class ChatManager:
|
|||
chat_inputs=chat_inputs,
|
||||
websocket=self.active_connections[client_id],
|
||||
)
|
||||
self.cache_manager.set(client_id, langchain_object)
|
||||
except Exception as e:
|
||||
# Log stack trace
|
||||
logger.exception(e)
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ import os
|
|||
|
||||
langflow_redis_host = os.environ.get("LANGFLOW_REDIS_HOST")
|
||||
langflow_redis_port = os.environ.get("LANGFLOW_REDIS_PORT")
|
||||
if langflow_redis_host and langflow_redis_port:
|
||||
broker_url = f"redis://{langflow_redis_host}:{langflow_redis_port}/0"
|
||||
result_backend = f"redis://{langflow_redis_host}:{langflow_redis_port}/0"
|
||||
else:
|
||||
if "BROKER_URL" in os.environ and "RESULT_BACKEND" in os.environ:
|
||||
broker_url = os.environ.get("BROKER_URL", "redis://localhost:6379/0")
|
||||
result_backend = os.environ.get("RESULT_BACKEND", "redis://localhost:6379/0")
|
||||
elif langflow_redis_host and langflow_redis_port:
|
||||
broker_url = f"redis://{langflow_redis_host}:{langflow_redis_port}/0"
|
||||
result_backend = f"redis://{langflow_redis_host}:{langflow_redis_port}/0"
|
||||
# tasks should be json or pickle
|
||||
accept_content = ["json", "pickle"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue