Skip to content

Commit aac38ae

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 efcca00 commit aac38ae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

batchspawner/batchspawner.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,14 +540,15 @@ async def start(self):
540540
# store on user for pre-jupyterhub-0.7:
541541
self.user.server.port = self.port
542542
self.user.server.ip = self.ip
543+
544+
if self.connect_to_job_cmd:
545+
await self.connect_to_job()
546+
543547
self.db.commit()
544548
self.log.info("Notebook server job {0} started at {1}:{2}".format(
545549
self.job_id, self.ip, self.port)
546550
)
547551

548-
if self.connect_to_job_cmd:
549-
await self.connect_to_job()
550-
551552
return self.ip, self.port
552553

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

0 commit comments

Comments
 (0)