feat(updater): Configurable min ratio

- `UPDATER_MIN_RATIO` variable
- `-minratio` flag for CLI operation
This commit is contained in:
Quentin McGaw
2022-06-12 14:03:00 +00:00
parent 1ea15a1a13
commit 9898387579
11 changed files with 61 additions and 12 deletions

View File

@@ -38,6 +38,15 @@ func envToInt(envKey string) (n int, err error) {
return strconv.Atoi(s)
}
func envToFloat64(envKey string) (f float64, err error) {
s := getCleanedEnv(envKey)
if s == "" {
return 0, nil
}
const bits = 64
return strconv.ParseFloat(s, bits)
}
func envToStringPtr(envKey string) (stringPtr *string) {
s := getCleanedEnv(envKey)
if s == "" {