Skip to content

Commit 453cd1c

Browse files
committed
Do not send notificaitons when import is cancelled
1 parent 1f55253 commit 453cd1c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/galaxy/api/plugin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ async def import_element(id_, context_):
6666
self._notification_success(id_, element)
6767
except ApplicationError as error:
6868
self._notification_failure(id_, error)
69+
except asyncio.CancelledError:
70+
pass
6971
except Exception:
7072
logger.exception("Unexpected exception raised in %s importer", self._name)
7173
self._notification_failure(id_, UnknownError())
@@ -74,10 +76,12 @@ async def import_elements(ids_, context_):
7476
try:
7577
imports = [import_element(id_, context_) for id_ in ids_]
7678
await asyncio.gather(*imports)
77-
finally:
7879
self._notification_finished()
79-
self._import_in_progress = False
8080
self._complete()
81+
except asyncio.CancelledError:
82+
logger.debug("Importing %s cancelled", self._name)
83+
finally:
84+
self._import_in_progress = False
8185

8286
self._task_manager.create_task(
8387
import_elements(ids, context),

0 commit comments

Comments
 (0)