mirror of
https://github.com/go-task/task.git
synced 2025-11-25 22:32:55 +02:00
Fix deadlock issue with run: once (#1025)
This commit is contained in:
8
task.go
8
task.go
@@ -342,11 +342,15 @@ func (e *Executor) startExecution(ctx context.Context, t *taskfile.Task, execute
|
||||
}
|
||||
|
||||
e.executionHashesMutex.Lock()
|
||||
otherExecutionCtx, ok := e.executionHashes[h]
|
||||
|
||||
if ok {
|
||||
if otherExecutionCtx, ok := e.executionHashes[h]; ok {
|
||||
e.executionHashesMutex.Unlock()
|
||||
e.Logger.VerboseErrf(logger.Magenta, "task: skipping execution of task: %s", h)
|
||||
|
||||
// Release our execution slot to avoid blocking other tasks while we wait
|
||||
reacquire := e.releaseConcurrencyLimit()
|
||||
defer reacquire()
|
||||
|
||||
<-otherExecutionCtx.Done()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user