3
0

Remove wrapping function from scheduler's watch()

This commit is contained in:
Denis Arh
2022-07-28 19:41:11 +02:00
parent f170760765
commit a59f1dd361

View File

@@ -140,16 +140,14 @@ func (svc *service) watch(ctx context.Context) {
svc.dispatch(ctx)
for {
func() {
select {
case <-svc.ticker().C:
svc.dispatch(ctx)
select {
case <-svc.ticker().C:
svc.dispatch(ctx)
case <-ctx.Done():
svc.log.Debug("done")
return
}
}()
case <-ctx.Done():
svc.log.Debug("done")
return
}
}
}