Skip to content

Commit

Permalink
for_instance to support more concurrent spawning
Browse files Browse the repository at this point in the history
  • Loading branch information
Fengping Hu committed Jun 27, 2024
1 parent f69d924 commit fee7395
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions binderhub/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def api_request(self, url, *args, **kwargs):
retry_delay = self.retry_delay
for i in range(1, self.retries + 1):
try:
return await AsyncHTTPClient().fetch(req)
return await AsyncHTTPClient(force_instance=True).fetch(req)
except HTTPError as e:
# swallow 409 errors on retry only (not first attempt)
if i > 1 and e.code == 409 and e.response:
Expand Down Expand Up @@ -190,7 +190,6 @@ async def launch(
- `token`: the token for the server
"""
# TODO: validate the image argument?

#get gpu availability data
config = generate_config()

Expand Down
2 changes: 1 addition & 1 deletion binderhub/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def get(self, provider_prefix, _unescaped_spec):

# Check if the nbviewer URL is valid and would display something
# useful to the reader, if not we don't show it
client = AsyncHTTPClient()
client = AsyncHTTPClient(force_instance=True)
# quote any unicode characters in the URL
proto, rest = nbviewer_url.split("://")
rest = urllib.parse.quote(rest)
Expand Down

0 comments on commit fee7395

Please sign in to comment.