This branch with celery async workers has no code errors, but running a GPT thread on the celery worker causes a SIGFAULT failure. Need to try this on a server instead of my local machine to see if it will run without failing. If it still fails, then I need to separate my async tasks and the flask app with the tasks dumping into the db and flask just pulling out of the DB.
This commit is contained in:
20
project/__init__.py
Normal file
20
project/__init__.py
Normal file
@ -0,0 +1,20 @@
|
||||
from flask import Flask
|
||||
|
||||
from .extensions import db
|
||||
from .views import main
|
||||
from .utils import make_celery
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///db.sqlite3"
|
||||
app.config["SECRET_KEY"] = "super-secret-key"
|
||||
app.config["CELERY_CONFIG"] = {"broker_url": "redis://localhost"}
|
||||
|
||||
db.init_app(app)
|
||||
|
||||
app.register_blueprint(main)
|
||||
|
||||
celery = make_celery(app)
|
||||
celery.set_default()
|
||||
|
||||
return app, celery
|
||||
Reference in New Issue
Block a user