Skip to content

Commit

Permalink
BatchSpawnerBase: Move connect_to_job before DB commit and debug logg…
Browse files Browse the repository at this point in the history
…ing.

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.
  • Loading branch information
olifre committed Jul 11, 2022
1 parent 4ffa087 commit b56fc82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions batchspawner/batchspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,16 +585,16 @@ async def start(self):
if hasattr(self, "mock_port"):
self.port = self.mock_port

if self.connect_to_job_cmd:
await self.connect_to_job()

self.db.commit()
self.log.info(
"Notebook server job {0} started at {1}:{2}".format(
self.job_id, self.ip, self.port
)
)

if self.connect_to_job_cmd:
await self.connect_to_job()

return self.ip, self.port

async def stop(self, now=False):
Expand Down

0 comments on commit b56fc82

Please sign in to comment.