mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-18 17:31:55 +08:00
feat: set the default max workers to the number of available CPU cores
This commit is contained in:
parent
12c208cad4
commit
5cb0463cf6
@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -14,7 +15,7 @@ import (
|
|||||||
sliceutil "github.com/usual2970/certimate/internal/pkg/utils/slice"
|
sliceutil "github.com/usual2970/certimate/internal/pkg/utils/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
var maxWorkers = 16
|
var maxWorkers = runtime.NumCPU()
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
envMaxWorkers := os.Getenv("CERTIMATE_WORKFLOW_MAX_WORKERS")
|
envMaxWorkers := os.Getenv("CERTIMATE_WORKFLOW_MAX_WORKERS")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user