Skip to content

Commit 00164fa

Browse files
committed
Correctly set _import_in_progress
1 parent 453cd1c commit 00164fa

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Diff for: src/galaxy/api/plugin.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ async def start(self, ids):
5858
if self._import_in_progress:
5959
raise ImportInProgress()
6060

61-
context = await self._prepare_context(ids)
62-
6361
async def import_element(id_, context_):
6462
try:
6563
element = await self._get(id_, context_)
@@ -83,12 +81,17 @@ async def import_elements(ids_, context_):
8381
finally:
8482
self._import_in_progress = False
8583

86-
self._task_manager.create_task(
87-
import_elements(ids, context),
88-
"{} import".format(self._name),
89-
handle_exceptions=False
90-
)
9184
self._import_in_progress = True
85+
try:
86+
context = await self._prepare_context(ids)
87+
self._task_manager.create_task(
88+
import_elements(ids, context),
89+
"{} import".format(self._name),
90+
handle_exceptions=False
91+
)
92+
except:
93+
self._import_in_progress = False
94+
raise
9295

9396

9497
class Plugin:

0 commit comments

Comments
 (0)