We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aba0474 commit 7efb340Copy full SHA for 7efb340
1 file changed
run.go
@@ -135,10 +135,13 @@ func (r *Run) Close() error {
135
return fmt.Errorf("run not started")
136
}
137
138
- if !r.lock.TryLock() {
139
- // If we can't get the lock, then the run is still running. Abort it.
140
- r.cancel(errAbortRun)
+ if r.lock.TryLock() {
+ r.lock.Unlock()
+ // If we can get the lock, then the run isn't running, so nothing to do.
141
+ return nil
142
143
+
144
+ r.cancel(errAbortRun)
145
if r.wait == nil {
146
return nil
147
0 commit comments