Skip to content

Commit

Permalink
Fix execution limit setting condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tobischo committed May 17, 2022
1 parent 72b857a commit 130f502
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion command_locker.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (ccl *ConsulCommandLocker) LockAndExecute(key, command string) (string, err

ctx := context.Background()
var cancel func()
if ccl.maxExecTime == 0 {
if ccl.maxExecTime != 0 {
ctx, cancel = context.WithTimeout(ctx, ccl.maxExecTime)
defer cancel()
}
Expand Down

0 comments on commit 130f502

Please sign in to comment.