refactors to use redis & celery

This commit is contained in:
2025-02-20 19:56:37 +01:00
parent f68ada7204
commit 5994d8ae7b
10 changed files with 427 additions and 154 deletions

View File

@@ -7,15 +7,18 @@ from app.views import register_views
from app.api import register_api
from app.config import load_config
from app.filters import register_filters
from app.tasks import celery
from app.logging_config import init_logger
def create_app():
def create_app(config=None):
app = Flask(__name__)
os.environ['TZ'] = 'UTC'
if config is None:
config = load_config()
app.config.update(config)
config = load_config()
os.environ['TZ'] = 'UTC'
app.config['SECRET_KEY'] = config['DEFAULT']['SECRET_KEY']
@@ -23,6 +26,9 @@ def create_app():
for key, value in config.get('BOOTSTRAP', {}).items():
app.config[key.upper()] = value
# Initialize Celery
celery.conf.update(app.config)
bootstrap = Bootstrap5(app)
# Store the entire config in Flask app