Skip to content

Commit ff9ab2a

Browse files
committed
Replace poll by query_job_status
Calling poll meant we would be running state_isrunning and state_ispending twice.
1 parent afa666b commit ff9ab2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

batchspawner/batchspawner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ async def start(self):
371371
if len(self.job_id) == 0:
372372
raise RuntimeError("Jupyter batch job submission failure (no jobid in output)")
373373
while True:
374-
await self.poll()
374+
await self.query_job_status()
375375
if self.state_isrunning():
376376
break
377377
else:
@@ -415,7 +415,7 @@ async def stop(self, now=False):
415415
if now:
416416
return
417417
for i in range(10):
418-
await self.poll()
418+
await self.query_job_status()
419419
if not self.state_isrunning() and not self.state_isunknown():
420420
return
421421
await gen.sleep(1.0)

0 commit comments

Comments
 (0)