From 625c246ba9f53fda6a700205ffd6509393d0a278 Mon Sep 17 00:00:00 2001 From: skjaro Date: Wed, 22 Dec 2021 20:15:49 +0100 Subject: [PATCH] Threads config support --- check_status.go | 9 ++++++++- inc/remotesupport.class.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/check_status.go b/check_status.go index 25b2d73..1f80a2a 100644 --- a/check_status.go +++ b/check_status.go @@ -116,8 +116,15 @@ func init() { } func main() { + + str_debug := os.Getenv("debug") + str_threads := os.Getenv("threads") + + threads, _ := strconv.Atoi(str_threads) + debug, _ := strconv.ParseBool(str_debug) + //startTime := time.Now() - results := boundedParallelGet(checks, 100) + results := boundedParallelGet(checks, threads) //seconds := time.Since(startTime).Seconds() //tmplate := "requests: %d/%d in %v" diff --git a/inc/remotesupport.class.php b/inc/remotesupport.class.php index d293084..f3af885 100644 --- a/inc/remotesupport.class.php +++ b/inc/remotesupport.class.php @@ -120,7 +120,7 @@ class PluginRemotesupportRemotesupport extends CommonDBTM ); $cwd = '/tmp'; - $env = array('debug' => 'false'); + $env = array('debug' => 'false', 'threads' => $config["threads"]); $process = proc_open($rs_path . '/bin/check_status', $descriptorspec, $pipes, $cwd, $env);