mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-06 12:43:18 +00:00
Don't create new app instance for background tasks. Reuse the old one!
This commit is contained in:
@ -13,16 +13,12 @@ mail = Mail()
|
||||
socketio = SocketIO()
|
||||
|
||||
|
||||
def create_app(config_name, main=True):
|
||||
def create_app(config_name):
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config[config_name])
|
||||
|
||||
config[config_name].init_app(app)
|
||||
db.init_app(app)
|
||||
|
||||
if not main:
|
||||
return app
|
||||
|
||||
login_manager.init_app(app)
|
||||
mail.init_app(app)
|
||||
socketio.init_app(app, message_qeue='redis://')
|
||||
|
Reference in New Issue
Block a user