chore(runner): wait workflow done before shutdown the service
This commit is contained in:
parent
cbd21b8ec5
commit
d1114da299
2 changed files with 8 additions and 4 deletions
|
@ -17,10 +17,7 @@ const (
|
|||
errorRetryTimeSleepSecs = 30
|
||||
)
|
||||
|
||||
var (
|
||||
ErrDataLock = errors.New("Data Lock Error")
|
||||
defaultLabels = []string{"self-hosted"}
|
||||
)
|
||||
var ErrDataLock = errors.New("Data Lock Error")
|
||||
|
||||
func New(cli client.Client, dispatch func(context.Context, *runnerv1.Task) error) *Poller {
|
||||
return &Poller{
|
||||
|
@ -39,6 +36,10 @@ type Poller struct {
|
|||
errorRetryCounter int
|
||||
}
|
||||
|
||||
func (p *Poller) Wait() {
|
||||
p.routineGroup.Wait()
|
||||
}
|
||||
|
||||
func (p *Poller) Poll(ctx context.Context, n int) error {
|
||||
for i := 0; i < n; i++ {
|
||||
func(i int) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue