Skip to content

Commit

Permalink
gbatch
Browse files Browse the repository at this point in the history
  • Loading branch information
snail007 committed May 17, 2024
1 parent 63f83e9 commit 09c9c50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/batch/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gbatch

import (
"context"
"errors"
"fmt"
gerror "github.com/snail007/gmc/module/error"
glist "github.com/snail007/gmc/util/list"
Expand Down Expand Up @@ -104,6 +105,9 @@ func (s *Executor) WaitFirstDone() (value interface{}, err error) {
}

func (s *Executor) waitFirst(checkSuccess bool) (value interface{}, err error) {
if len(s.tasks) == 0 {
return nil, errors.New("tasks is empty")
}
g := sync.WaitGroup{}
g.Add(len(s.tasks))
waitChan := make(chan taskResult)
Expand Down

0 comments on commit 09c9c50

Please sign in to comment.