|
|
|
@ -76,7 +76,6 @@ func (n *Notifier) Send(ctx context.Context) {
|
|
|
|
|
n.c <- ctx
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO(wperron) is there a (nice) way to instrument this function?
|
|
|
|
|
func (n *Notifier) NotifyFunc(ctx context.Context, f func(context.Context)) {
|
|
|
|
|
for {
|
|
|
|
|
select {
|
|
|
|
@ -84,8 +83,11 @@ func (n *Notifier) NotifyFunc(ctx context.Context, f func(context.Context)) {
|
|
|
|
|
log.Debug().Msg("context deadline exceeded, exiting notify func")
|
|
|
|
|
return
|
|
|
|
|
case innerCtx := <-n.c:
|
|
|
|
|
innerCtx, span := tracer.Start(innerCtx, "notify_func")
|
|
|
|
|
log.Debug().Ctx(innerCtx).Msg("tick received, notifying function")
|
|
|
|
|
|
|
|
|
|
f(innerCtx)
|
|
|
|
|
span.End()
|
|
|
|
|
}
|
|
|
|
|
time.Sleep(time.Second)
|
|
|
|
|
}
|
|
|
|
|