From 451a1139873bc8efcdd94c89e9951f0b30f8b2ec Mon Sep 17 00:00:00 2001 From: William Perron Date: Sun, 3 Mar 2024 16:17:14 -0500 Subject: [PATCH] add root span for weekly reminder --- cmd/themis-server/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/themis-server/main.go b/cmd/themis-server/main.go index 52c662b..90dee27 100644 --- a/cmd/themis-server/main.go +++ b/cmd/themis-server/main.go @@ -732,6 +732,12 @@ func main() { log.Info().Int("count", len(created)).Dur("startup_latency_ms", time.Since(start)).Msg("registered commands, ready to operate") go notifier.NotifyFunc(ctx, func() { + ctx, cancel := context.WithTimeout(ctx, 5*time.Second) + defer cancel() + + ctx, span := tracer.Start(ctx, "weekly notification", trace.WithNewRoot()) + defer span.End() + log.Info().Msg("sending weekly reminder") absentees, err := store.GetAbsentees(ctx, themis.NextMonday()) if err != nil {