From c9b2f8ca2239d64eaede7a0d755f038fe506bcca Mon Sep 17 00:00:00 2001 From: SayaAndy Date: Fri, 15 Aug 2025 00:51:07 +0700 Subject: refactor: split semaphore into pre-process & process --- config/config-b2.sample.json | 3 ++- config/config-local-unix.sample.json | 3 ++- config/config.go | 13 +++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/config-b2.sample.json b/config/config-b2.sample.json index d3d772e..c48b1b2 100644 --- a/config/config-b2.sample.json +++ b/config/config-b2.sample.json @@ -1,6 +1,7 @@ { "ForceRewrite": false, - "MaxConcurrentJobs": 4, + "MaxProcessThreads": 4, + "MaxPreProcessThreads": 12, "LogLevel": "info", "Input": { "Storage": { diff --git a/config/config-local-unix.sample.json b/config/config-local-unix.sample.json index 637a05a..36d8114 100644 --- a/config/config-local-unix.sample.json +++ b/config/config-local-unix.sample.json @@ -1,6 +1,7 @@ { "ForceRewrite": false, - "MaxConcurrentJobs": 4, + "MaxProcessThreads": 4, + "MaxPreProcessThreads": 12, "LogLevel": "debug", "Input": { "Storage": { diff --git a/config/config.go b/config/config.go index d2b7072..5b05ce9 100644 --- a/config/config.go +++ b/config/config.go @@ -10,12 +10,13 @@ import ( ) type Config struct { - Input InputConfig `json:"Input" validate:"required"` - Converter ConverterConfig `json:"Converter" validate:"required"` - Output OutputConfig `json:"Output" validate:"required"` - MaxConcurrentJobs int `json:"MaxConcurrentJobs" validate:"required,min=1"` - ForceRewrite bool `json:"ForceRewrite" validate:"required"` - LogLevel slog.Level `json:"LogLevel" validate:"required"` + Input InputConfig `json:"Input" validate:"required"` + Converter ConverterConfig `json:"Converter" validate:"required"` + Output OutputConfig `json:"Output" validate:"required"` + MaxProcessThreads int `json:"MaxProcessThreads" validate:"required,min=1"` + MaxPreProcessThreads int `json:"MaxPreProcessThreads" validate:"min=1;gtefield=MaxProcessThreads"` + ForceRewrite bool `json:"ForceRewrite" validate:"required"` + LogLevel slog.Level `json:"LogLevel" validate:"required"` } type InputConfig struct { -- cgit v1.3.1+13