Skip to content

Commit

Permalink
🥚 Increate fastcdn timeout from 3 to 10 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
waketzheng committed Oct 17, 2024
1 parent 57a310b commit 16507a0
Show file tree
Hide file tree
Showing 4 changed files with 305 additions and 275 deletions.
6 changes: 4 additions & 2 deletions fastapi_cdn_host/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ async def download_offline_assets(dirname: str) -> None:
print("Result:", urls)
with spinnerbar("Fetching files from cdn", color="yellow"):
url_list = [urls.js, urls.css, urls.redoc]
contents = await HttpSniff.bulk_fetch(url_list, get_content=True)
contents = await HttpSniff.bulk_fetch(
url_list, get_content=True, total_seconds=10
)
for url, content in zip(url_list, contents):
if not content:
print(f"Failed to fetch content from {url}")
print(f"[red]ERROR:[/red] Failed to fetch content from {url}")
else:
path = static_root / Path(url).name
size = await path.write_bytes(content)
Expand Down
Loading

0 comments on commit 16507a0

Please sign in to comment.