improve cmd

This commit is contained in:
ginuerzh
2022-01-20 23:50:56 +08:00
parent 3ef98c16aa
commit bb889412d2
3 changed files with 52 additions and 19 deletions

View File

@ -93,6 +93,10 @@ func GetDuration(md Metadata, key string) (v time.Duration) {
return time.Duration(vv) * time.Second
case string:
v, _ = time.ParseDuration(vv)
if v == 0 {
n, _ := strconv.Atoi(vv)
v = time.Duration(n) * time.Second
}
}
return
}