nix-channels: Larger batch size and configurable

This commit is contained in:
dramforever 2020-03-06 23:32:00 +08:00
parent d00613ee40
commit 730e542b48

View File

@ -26,6 +26,8 @@ else:
MIRROR_BASE_URL = os.getenv("MIRROR_BASE_URL", 'https://mirrors.tuna.tsinghua.edu.cn/nix-channels') MIRROR_BASE_URL = os.getenv("MIRROR_BASE_URL", 'https://mirrors.tuna.tsinghua.edu.cn/nix-channels')
WORKING_DIR = os.getenv("TUNASYNC_WORKING_DIR", 'working-channels') WORKING_DIR = os.getenv("TUNASYNC_WORKING_DIR", 'working-channels')
PATH_BATCH = int(os.getenv('NIX_MIRROR_PATH_BATCH', 8192))
STORE_DIR = 'store' STORE_DIR = 'store'
RELEASES_DIR = 'releases' RELEASES_DIR = 'releases'
CLONE_SINCE = datetime(2018, 12, 1) CLONE_SINCE = datetime(2018, 12, 1)
@ -290,8 +292,6 @@ def update_channels(channels):
# Batch paths to avoid E2BIG # Batch paths to avoid E2BIG
PATH_BATCH = 128
channel_failure = False channel_failure = False
for i in range(0, len(paths), PATH_BATCH): for i in range(0, len(paths), PATH_BATCH):