Skip to content

Commit 701e844

Browse files
committed
Kill instance when leaving ensure_runnables_served scope
1 parent 47039b7 commit 701e844

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

planemo/engine/galaxy.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ def ensure_runnables_served(self, runnables):
145145
with serve_daemon(self._ctx, runnables, **self._serve_kwds()) as config:
146146
if "install_args_list" in self._serve_kwds():
147147
self.shed_install(config)
148-
yield config
148+
try:
149+
yield config
150+
finally:
151+
config.kill()
149152

150153
def shed_install(self, config):
151154
kwds = self._serve_kwds()
@@ -208,7 +211,10 @@ def ensure_runnables_served(self, runnables):
208211
with serve_daemon(self._ctx, runnables, **self._serve_kwds()) as config:
209212
if "install_args_list" in self._serve_kwds():
210213
self.shed_install(config)
211-
yield config
214+
try:
215+
yield config
216+
finally:
217+
config.kill()
212218

213219

214220
class ExternalGalaxyEngine(GalaxyEngine):

0 commit comments

Comments
 (0)