Merge pull request #134 from openreplay/dev

fix(backend): FS_CLEAN_HRS value
This commit is contained in:
Alex K 2021-08-07 11:59:59 +08:00 committed by GitHub
commit 7358d95d6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 13 deletions

View file

@ -42,7 +42,7 @@ ENV TZ=UTC \
AWS_REGION_ASSETS=eu-central-1 \
CACHE_ASSETS=false \
ASSETS_SIZE_LIMIT=6291456 \
FS_CLEAN_HRS=0
FS_CLEAN_HRS=240
ARG SERVICE_NAME

View file

@ -18,24 +18,24 @@ func StringOptional(key string) string {
return os.Getenv(key)
}
func Uint16(key string) uint16 {
v := String(key)
n, _ := strconv.ParseUint(v, 10, 16)
if n == 0 {
log.Fatalln(key + " has a wrong value")
}
return uint16(n)
}
func Uint64(key string) uint64 {
v := String(key)
n, _ := strconv.ParseUint(v, 10, 64)
if n == 0 {
log.Fatalln(key + " has a wrong value")
n, err := strconv.ParseUint(v, 10, 64)
if err != nil {
log.Fatalln(key + " has a wrong value. ", err)
}
return n
}
func Uint16(key string) uint16 {
v := String(key)
n, err := strconv.ParseUint(v, 10, 16)
if err != nil {
log.Fatalln(key + " has a wrong value. ", err)
}
return uint16(n)
}
func Int(key string) int {
return int(Uint64(key))
}