Capture error when celery back-end does not support forgetting tasks (#10770)

This commit is contained in:
Will Barrett 2020-12-02 09:47:02 -08:00 committed by GitHub
parent f2d9f00013
commit 1842c56209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -2240,7 +2240,13 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
# Explicitly forget the task to ensure the task metadata is removed from the
# Celery results backend in a timely manner.
task.forget()
try:
task.forget()
except NotImplementedError:
logger.warning(
"Unable to forget Celery task as backend"
"does not support this operation"
)
except Exception as ex: # pylint: disable=broad-except
logger.exception("Query %i: %s", query.id, str(ex))
msg = _(