You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2020/07/10 16:54:13 UTC

[incubator-superset] branch master updated: chore: Releasing SQL Lab Celery results (#10279)

This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e4ccd4  chore: Releasing SQL Lab Celery results (#10279)
4e4ccd4 is described below

commit 4e4ccd48d64adf187dbc682ebf68a3954a37b943
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Fri Jul 10 09:53:57 2020 -0700

    chore: Releasing SQL Lab Celery results (#10279)
    
    Co-authored-by: John Bodley <jo...@airbnb.com>
---
 superset/views/core.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index fea37b9..bce09963 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2101,7 +2101,7 @@ class Superset(BaseSupersetView):  # pylint: disable=too-many-public-methods
         logger.info("Query %i: Running query on a Celery worker", query.id)
         # Ignore the celery future object and the request may time out.
         try:
-            sql_lab.get_sql_results.delay(
+            task = sql_lab.get_sql_results.delay(
                 query.id,
                 rendered_query,
                 return_results=False,
@@ -2111,6 +2111,10 @@ class Superset(BaseSupersetView):  # pylint: disable=too-many-public-methods
                 expand_data=expand_data,
                 log_params=log_params,
             )
+
+            # Explicitly forget the task to ensure the task metadata is removed from the
+            # Celery results backend in a timely manner.
+            task.forget()
         except Exception as ex:  # pylint: disable=broad-except
             logger.exception("Query %i: %s", query.id, str(ex))
             msg = _(