You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/07/30 07:34:00 UTC
[GitHub] [incubator-superset] villebro commented on a change in pull request #10427: chore: Cleanup database sessions
villebro commented on a change in pull request #10427:
URL: https://github.com/apache/incubator-superset/pull/10427#discussion_r462761463
##########
File path: superset/tasks/schedules.py
##########
@@ -542,16 +541,15 @@ def schedule_alert_query( # pylint: disable=unused-argument
recipients: Optional[str] = None,
) -> None:
model_cls = get_scheduler_model(report_type)
- dbsession = db.create_scoped_session()
- schedule = dbsession.query(model_cls).get(schedule_id)
+ schedule = db.session.query(model_cls).get(schedule_id)
Review comment:
This has me wondering, is there risk that this gets torn down prematurely by the initiating session's closure? My intuition says it shouldn't, but it seems strange that this would have been put here by accident.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org