##// END OF EJS Templates
Backport PR #10408: Speed up shutdown by eliminating unnecessary sleeping...
Thomas Kluyver -
Show More
@@ -246,6 +246,8 b' class ScriptMagics(Magics):'
246
246
247 def kill_bg_processes(self):
247 def kill_bg_processes(self):
248 """Kill all BG processes which are still running."""
248 """Kill all BG processes which are still running."""
249 if not self.bg_processes:
250 return
249 for p in self.bg_processes:
251 for p in self.bg_processes:
250 if p.poll() is None:
252 if p.poll() is None:
251 try:
253 try:
@@ -253,6 +255,9 b' class ScriptMagics(Magics):'
253 except:
255 except:
254 pass
256 pass
255 time.sleep(0.1)
257 time.sleep(0.1)
258 self._gc_bg_processes()
259 if not self.bg_processes:
260 return
256 for p in self.bg_processes:
261 for p in self.bg_processes:
257 if p.poll() is None:
262 if p.poll() is None:
258 try:
263 try:
@@ -260,6 +265,9 b' class ScriptMagics(Magics):'
260 except:
265 except:
261 pass
266 pass
262 time.sleep(0.1)
267 time.sleep(0.1)
268 self._gc_bg_processes()
269 if not self.bg_processes:
270 return
263 for p in self.bg_processes:
271 for p in self.bg_processes:
264 if p.poll() is None:
272 if p.poll() is None:
265 try:
273 try:
General Comments 0
You need to be logged in to leave comments. Login now