mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 15:23:27 +08:00
use create_light_app in job runner
This commit is contained in:
parent
1f4637c064
commit
ac216e7a08
1 changed files with 3 additions and 3 deletions
|
@ -16,17 +16,17 @@ from app.email_utils import (
|
||||||
send_email,
|
send_email,
|
||||||
render,
|
render,
|
||||||
)
|
)
|
||||||
from app.import_utils import handle_batch_import
|
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
|
from app.import_utils import handle_batch_import
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import User, Job, BatchImport
|
from app.models import User, Job, BatchImport
|
||||||
from server import create_app
|
from server import create_light_app
|
||||||
|
|
||||||
|
|
||||||
# fix the database connection leak issue
|
# fix the database connection leak issue
|
||||||
# use this method instead of create_app
|
# use this method instead of create_app
|
||||||
def new_app():
|
def new_app():
|
||||||
app = create_app()
|
app = create_light_app()
|
||||||
|
|
||||||
@app.teardown_appcontext
|
@app.teardown_appcontext
|
||||||
def shutdown_session(response_or_exc):
|
def shutdown_session(response_or_exc):
|
||||||
|
|
Loading…
Reference in a new issue