Skip to content

Commit

Permalink
nix-channels: add timeout for minio
Browse files Browse the repository at this point in the history
It's found that nix-channels is stuck at "- Fetching channels" for nearly 2 days today.
  • Loading branch information
taoky committed May 11, 2024
1 parent 5639b37 commit 5970c86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nix-channels/nix-channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from concurrent.futures import ThreadPoolExecutor

from urllib3.util.retry import Retry
from urllib3 import PoolManager

### Config

Expand Down Expand Up @@ -139,7 +140,10 @@ def download(url, dest):

download_dest.rename(dest)

client = minio.Minio('s3.amazonaws.com')
def minio_client_with_timeout(timeout):
return PoolManager(timeout=timeout, retries=retries)

client = minio.Minio('s3.amazonaws.com', http_client=minio_client_with_timeout(TIMEOUT))

def get_channels():
return [
Expand Down

0 comments on commit 5970c86

Please sign in to comment.