Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Nov 26, 2024
1 parent a864c49 commit 6bcddac
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
21 changes: 0 additions & 21 deletions global/global.go

This file was deleted.

24 changes: 24 additions & 0 deletions global/max_threads.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package global

import (
"os"
"strconv"

"github.com/projectdiscovery/utils/sysutil"
)

const OS_MAX_THREADS_ENV = "OS_MAX_THREADS"

func init() {
handleOSMaxThreads()
}

func handleOSMaxThreads() {
osMaxThreads := os.Getenv(OS_MAX_THREADS_ENV)
if osMaxThreads == "" {
return
}
if value, err := strconv.Atoi(osMaxThreads); err == nil && value > 0 {
_ = sysutil.SetMaxThreads(value)
}
}

0 comments on commit 6bcddac

Please sign in to comment.