celery load

This commit is contained in:
Alex
2023-04-06 12:16:30 +01:00
parent b9efb98280
commit 9395d2c091
2 changed files with 10 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ from werkzeug.utils import secure_filename
from error import bad_request
from worker import ingest_worker
import celeryconfig
# os.environ["LANGCHAIN_HANDLER"] = "langchain"
@@ -92,8 +93,8 @@ app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER = "inputs"
app.config['CELERY_BROKER_URL'] = os.getenv("CELERY_BROKER_URL")
app.config['CELERY_RESULT_BACKEND'] = os.getenv("CELERY_RESULT_BACKEND")
app.config['MONGO_URI'] = os.getenv("MONGO_URI")
celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL'], backend=app.config['CELERY_RESULT_BACKEND'])
celery.conf.update(app.config)
celery = Celery()
celery.config_from_object(celeryconfig)
mongo = MongoClient(app.config['MONGO_URI'])
db = mongo["docsgpt"]
vectors_collection = db["vectors"]