imgbundler: Use time.Ticker instead
This commit is contained in:
parent
e3104688a6
commit
1d2ea2bb87
1 changed files with 3 additions and 1 deletions
|
|
@ -122,11 +122,13 @@ func runWorkers(ctx context.Context, ms *xmain.State, svg []byte, imgs [][][]byt
|
|||
}
|
||||
}()
|
||||
|
||||
t := time.NewTicker(time.Second * 5)
|
||||
defer t.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return svg, xerrors.Errorf("failed to wait for workers: %w", ctx.Err())
|
||||
case <-time.After(time.Second * 5):
|
||||
case <-t.C:
|
||||
ms.Log.Info.Printf("fetching images...")
|
||||
case repl, ok := <-replc:
|
||||
if !ok {
|
||||
|
|
|
|||
Loading…
Reference in a new issue