feat: set the default max workers to the number of available CPU cores

This commit is contained in:
Fu Diwei 2025-05-07 15:30:25 +08:00
parent 12c208cad4
commit 5cb0463cf6

View File

@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"os"
"runtime"
"strconv"
"sync"
"time"
@ -14,7 +15,7 @@ import (
sliceutil "github.com/usual2970/certimate/internal/pkg/utils/slice"
)
var maxWorkers = 16
var maxWorkers = runtime.NumCPU()
func init() {
envMaxWorkers := os.Getenv("CERTIMATE_WORKFLOW_MAX_WORKERS")