From 6b99919dd7e6eabe73e66b9e30ead0f64a511313 Mon Sep 17 00:00:00 2001 From: William Perron Date: Sun, 11 Feb 2024 15:34:38 -0500 Subject: [PATCH] fix context TODO usage in main.go --- cmd/themis-server/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/themis-server/main.go b/cmd/themis-server/main.go index 71a8b9a..908385e 100644 --- a/cmd/themis-server/main.go +++ b/cmd/themis-server/main.go @@ -92,7 +92,7 @@ func main() { } defer store.Close() - if err := initTracing(db); err != nil { + if err := initTracing(ctx, db); err != nil { log.Fatal().Err(err).Msg("failed to initialize tracing") } @@ -852,7 +852,7 @@ func registerHandlers(sess *discordgo.Session, handlers map[string]Handler) { userId := i.Member.User.ID log.Info().Ctx(ctx).Str("message_component", "schedule-response").Str("userid", userId).Msg("handling message component interaction") - if err := store.AddAbsence(context.TODO(), themis.NextMonday(), userId); err != nil { + if err := store.AddAbsence(ctx, themis.NextMonday(), userId); err != nil { if err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ @@ -1019,8 +1019,8 @@ func parseCustomIDState(qs string) (url.Values, error) { return v, nil } -func initTracing(db *sql.DB) error { - res, err := resource.New(context.TODO(), +func initTracing(ctx context.Context, db *sql.DB) error { + res, err := resource.New(ctx, resource.WithHost(), resource.WithOS(), resource.WithProcess(),