windows flimit fix
This commit is contained in:
parent
f6d63cc8ab
commit
586fd218f5
|
@ -0,0 +1,16 @@
|
|||
// build !windows
|
||||
|
||||
package settings
|
||||
|
||||
import "syscall"
|
||||
|
||||
// Flimit defines the max number of watched files
|
||||
func (s *Settings) Flimit() {
|
||||
var rLimit syscall.Rlimit
|
||||
rLimit.Max = s.Config.Flimit
|
||||
rLimit.Cur = s.Config.Flimit
|
||||
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
if err != nil {
|
||||
s.Fatal("Error Setting Rlimit", err)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package settings
|
||||
|
||||
import "syscall"
|
||||
|
||||
// Flimit defines the max number of watched files
|
||||
func (s *Settings) Flimit() {
|
||||
return
|
||||
}
|
Loading…
Reference in New Issue