change: skip setting ulimit for windows

This commit is contained in:
debugtalk
2021-12-30 16:22:08 +08:00
parent ce25a14fa8
commit 3c54bf230b
2 changed files with 6 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package cmd
import (
"runtime"
"syscall"
"time"
@@ -74,6 +75,10 @@ func init() {
// set resource limit
// ulimit -n 10240
func setUlimit() {
if runtime.GOOS == "windows" {
log.Warn().Msg("windows does not support setting ulimit")
return
}
var rLimit syscall.Rlimit
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {