Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

rlimit.go 416B

123456789101112131415161718192021222324
  1. // +build !windows
  2. package utils
  3. import (
  4. "fmt"
  5. "golang.org/x/sys/unix"
  6. )
  7. func SetLimits() error {
  8. rLimit := unix.Rlimit{}
  9. if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rLimit); err != nil {
  10. return fmt.Errorf("cannot get rlimit: %w", err)
  11. }
  12. rLimit.Cur = rLimit.Max
  13. if err := unix.Setrlimit(unix.RLIMIT_NOFILE, &rLimit); err != nil {
  14. return fmt.Errorf("cannot set rlimit: %w", err)
  15. }
  16. return nil
  17. }