Skip to content

Commit b56fc82

Browse files
committed
BatchSpawnerBase: Move connect_to_job before DB commit and debug logging.
With this, the first database commit will already contain the forwarded port if connect_to_job is used, and the log will show the correct port number.
1 parent 4ffa087 commit b56fc82

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

batchspawner/batchspawner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,16 +585,16 @@ async def start(self):
585585
if hasattr(self, "mock_port"):
586586
self.port = self.mock_port
587587

588+
if self.connect_to_job_cmd:
589+
await self.connect_to_job()
590+
588591
self.db.commit()
589592
self.log.info(
590593
"Notebook server job {0} started at {1}:{2}".format(
591594
self.job_id, self.ip, self.port
592595
)
593596
)
594597

595-
if self.connect_to_job_cmd:
596-
await self.connect_to_job()
597-
598598
return self.ip, self.port
599599

600600
async def stop(self, now=False):

0 commit comments

Comments
 (0)