michael-s-molina commented on code in PR #26186:
URL: https://github.com/apache/superset/pull/26186#discussion_r1442113283
##########
superset/tasks/celery_app.py:
##########
@@ -43,3 +43,27 @@ def reset_db_connection_pool(**kwargs: Any) -> None: #
pylint: disable=unused-a
with flask_app.app_context():
#
https://docs.sqlalchemy.org/en/14/core/connections.html#engine-disposal
db.engine.dispose()
+
+
+@task_postrun.connect
+def teardown( # pylint: disable=unused-argument
+ retval: Any,
+ *args: Any,
+ **kwargs: Any,
+) -> None:
+ """
+ After each Celery task teardown the Flask-SQLAlchemy session.
+
+ Note for non eagar requests Flask-SQLAlchemy will perform the teardown.
Review Comment:
```suggestion
Note for non eager requests Flask-SQLAlchemy will perform the teardown.
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]