From 5254af8349dbd256009c803fc1a5d42e4c2f9dd7 Mon Sep 17 00:00:00 2001 From: shanurrahman Date: Thu, 1 Feb 2024 23:28:13 -0800 Subject: [PATCH] Add missing files to .gitignore and update Celery configuration --- .gitignore | 1 + llm-server/celery_app.py | 12 +++++------- .../shared/models/opencopilot_db/database_setup.py | 3 +++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0150f430f..535a28508 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ yarn-error.log test.html .aider* +logs \ No newline at end of file diff --git a/llm-server/celery_app.py b/llm-server/celery_app.py index cf3fff329..2e8dbbeca 100644 --- a/llm-server/celery_app.py +++ b/llm-server/celery_app.py @@ -1,15 +1,13 @@ +import os from celery import Celery from shared.models.opencopilot_db import create_database_schema -from dotenv import load_dotenv -import os -load_dotenv() create_database_schema() app = Celery( - 'opencopilot_celery', - broker=os.getenv("CELERY_BROKER", 'redis://redis:6379/0'), - backend=os.getenv("CELERY_BACKEND",'redis://redis:6379/1') + "opencopilot_celery", + broker=os.getenv("CELERY_BROKER", "redis://redis:6379/0"), + backend=os.getenv("CELERY_BACKEND", "redis://redis:6379/1"), ) -app.conf.imports = ('workers.tasks',) \ No newline at end of file +app.conf.imports = ("workers.tasks",) diff --git a/llm-server/shared/models/opencopilot_db/database_setup.py b/llm-server/shared/models/opencopilot_db/database_setup.py index d9a626770..6bae6cdc0 100644 --- a/llm-server/shared/models/opencopilot_db/database_setup.py +++ b/llm-server/shared/models/opencopilot_db/database_setup.py @@ -2,6 +2,9 @@ from sqlalchemy.pool import QueuePool from sqlalchemy.ext.declarative import declarative_base # Import declarative_base from utils.llm_consts import get_mysql_uri +from dotenv import load_dotenv + +load_dotenv() # Replace these values with your MySQL server details db_url = get_mysql_uri()