瀏覽代碼

Strip whitespace from worker types in Dockerfile-workers (#14165)

tags/v1.70.0rc1
realtyem 1 年之前
committed by GitHub
父節點
當前提交
c75836fe77
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 2 個文件被更改,包括 3 次插入4 次删除
  1. +1
    -0
      changelog.d/14165.docker
  2. +2
    -4
      docker/configure_workers_and_start.py

+ 1
- 0
changelog.d/14165.docker 查看文件

@@ -0,0 +1 @@
Prevent a class of database sharding errors when using `Dockerfile-workers` to spawn multiple instances of the same worker. Contributed by Jason Little.

+ 2
- 4
docker/configure_workers_and_start.py 查看文件

@@ -402,8 +402,8 @@ def generate_worker_files(
# No workers, just the main process
worker_types = []
else:
# Split type names by comma
worker_types = worker_types_env.split(",")
# Split type names by comma, ignoring whitespace.
worker_types = [x.strip() for x in worker_types_env.split(",")]

# Create the worker configuration directory if it doesn't already exist
os.makedirs("/conf/workers", exist_ok=True)
@@ -422,8 +422,6 @@ def generate_worker_files(

# For each worker type specified by the user, create config values
for worker_type in worker_types:
worker_type = worker_type.strip()

worker_config = WORKERS_CONFIG.get(worker_type)
if worker_config:
worker_config = worker_config.copy()


Loading…
取消
儲存