mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-27 15:53:57 +00:00
23 lines
463 B
Go
23 lines
463 B
Go
package execenv
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"runtime"
|
|
|
|
"github.com/c4ei/yunseokyeol/infrastructure/os/limits"
|
|
)
|
|
|
|
// Initialize initializes the execution environment required to run c4exd
|
|
func Initialize(desiredLimits *limits.DesiredLimits) {
|
|
// Use all processor cores.
|
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
|
|
|
// Up some limits.
|
|
if err := limits.SetLimits(desiredLimits); err != nil {
|
|
fmt.Fprintf(os.Stderr, "failed to set limits: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
}
|