app registration check

This commit is contained in:
nquidox 2026-03-20 13:44:53 +03:00
parent 287b1f5a30
commit 08d8450dac
4 changed files with 101 additions and 10 deletions

View file

@ -39,3 +39,15 @@ func getEnvUint(key string, fallback uint) uint {
}
return fallback
}
func getEnvInt(key string, fallback int) int {
if value, ok := os.LookupEnv(key); ok {
num, err := strconv.Atoi(value)
if err != nil {
log.Printf("Error converting %v to int, using fallback value - %v", key, fallback)
return fallback
}
return num
}
return fallback
}