Skip to content

Commit

Permalink
Migrate tornado.gen to asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph0tonic committed Feb 13, 2024
1 parent 61603a1 commit 07177b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions batchspawner/batchspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ async def start(self):
else:
self.log.info("no ip in log yet")

await gen.sleep(self.startup_poll_interval)
await asyncio.sleep(self.startup_poll_interval)

self.ip = self.state_gethost()
while self.port == 0:
Expand Down Expand Up @@ -1433,7 +1433,7 @@ async def progress(self):
"message": "Unknown status...",
}
)
await gen.sleep(1)
await asyncio.sleep(1)

async def start(self):
"""Start the process"""
Expand Down Expand Up @@ -1499,7 +1499,7 @@ async def start(self):
" while pending in the queue or died immediately"
" after starting."
)
await gen.sleep(self.startup_poll_interval)
await asyncio.sleep(self.startup_poll_interval)

while True:
self.log.info("\033[31mloop for running job\033[0m")
Expand All @@ -1525,15 +1525,15 @@ async def start(self):
else:
self.log.info("no ip in log yet")

await gen.sleep(self.startup_poll_interval)
await asyncio.sleep(self.startup_poll_interval)

# self.ip = "127.0.0.1" #self.state_gethost()
self.ip = "148.187.151.63" # self.state_gethost()
self.port = self.anticipated_port
self.server.port = self.anticipated_port

while self.port == 0:
await gen.sleep(self.startup_poll_interval)
await asyncio.sleep(self.startup_poll_interval)
# Test framework: For testing, mock_port is set because we
# don't actually run the single-user server yet.
if hasattr(self, "mock_port"):
Expand Down

0 comments on commit 07177b3

Please sign in to comment.