Add ability to configure object reaper interval for different executor types (#2543)

Added properties to configure object reaper interval, global and specific to exec type.

OBJECT_REAPER_INTERVAL - global
NEWDEPLOY_OBJECT_REAPER_INTERVAL - for new deploy type
CONTAINER_OBJECT_REAPER_INTERVAL - for container type
POOLMGR_OBJECT_REAPER_INTERVAL - for poolmgr
This commit is contained in:
Andrey Dudin
2022-09-23 11:35:13 +05:30
committed by GitHub
parent da50c3759d
commit 1102999b4d
9 changed files with 251 additions and 27 deletions
+21
View File
@@ -26,6 +26,7 @@ import (
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/mholt/archiver/v3"
@@ -225,3 +226,23 @@ func GetCurrentNamespace() (string, error) {
}
return string(body), nil
}
func GetStringValueFromEnv(envVar string) (string, error) {
v := os.Getenv(envVar)
if v == "" {
return v, errors.New(fmt.Sprintf("Еnvironment variable %s empty", envVar))
}
return v, nil
}
func GetUIntValueFromEnv(envVar string) (uint, error) {
s, err := GetStringValueFromEnv(envVar)
if err != nil {
return 0, err
}
value, err := strconv.ParseUint(s, 10, 32)
if err != nil {
return 0, err
}
return uint(value), nil
}