Skip to content

Commit

Permalink
Update isValidDuration function
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Jiao <yang.jiao@broadcom.com>
  • Loading branch information
Yang Jiao committed Jan 15, 2024
1 parent eb12541 commit f81d0e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/v2.0/handler/robot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f81d0e5

Please sign in to comment.