diff --git a/src/server/v2.0/handler/robot.go b/src/server/v2.0/handler/robot.go index 52e1cb1ad..fff5f2aac 100644 --- a/src/server/v2.0/handler/robot.go +++ b/src/server/v2.0/handler/robot.go @@ -374,7 +374,7 @@ func isValidLevel(l string) bool { } func isValidDuration(d int64) bool { - return d >= int64(-1) && d != 0 && d < math.MaxInt32 + return d == -1 || (d > 0 && d < math.MaxInt32) } // validateName validates the robot name, especially '+' cannot be a valid character