pad worker numbering

This commit is contained in:
zowoq 2023-11-09 17:18:03 +10:00 committed by Jörg Thalheim
parent 0b145d91d8
commit 2a565a8d5a
2 changed files with 3 additions and 3 deletions

View file

@ -734,7 +734,7 @@ class NixConfigurator(ConfiguratorBase):
for item in worker_config:
cores = item.get("cores", 0)
for i in range(cores):
worker_name = f"{item['name']}-{i}"
worker_name = f"{item['name']}-{i:03}"
config["workers"].append(worker.Worker(worker_name, item["pass"]))
worker_names.append(worker_name)

View file

@ -29,11 +29,11 @@ class WorkerConfig:
def setup_worker(
application: service.Application, id: int, config: WorkerConfig
) -> None:
basedir = f"{config.buildbot_dir}-{id}"
basedir = f"{config.buildbot_dir}-{id:03}"
os.makedirs(basedir, mode=0o700, exist_ok=True)
hostname = socket.gethostname()
workername = f"{hostname}-{id}"
workername = f"{hostname}-{id:03}"
keepalive = 600
umask = None
maxdelay = 300