refactors to use redis & celery
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user