|
|
@ -92,7 +92,7 @@ func main() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defer store.Close()
|
|
|
|
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")
|
|
|
|
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
|
|
|
|
userId := i.Member.User.ID
|
|
|
|
log.Info().Ctx(ctx).Str("message_component", "schedule-response").Str("userid", userId).Msg("handling message component interaction")
|
|
|
|
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{
|
|
|
|
if err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
|
|
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
|
|
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
|
|
|
Data: &discordgo.InteractionResponseData{
|
|
|
|
Data: &discordgo.InteractionResponseData{
|
|
|
@ -1019,8 +1019,8 @@ func parseCustomIDState(qs string) (url.Values, error) {
|
|
|
|
return v, nil
|
|
|
|
return v, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func initTracing(db *sql.DB) error {
|
|
|
|
func initTracing(ctx context.Context, db *sql.DB) error {
|
|
|
|
res, err := resource.New(context.TODO(),
|
|
|
|
res, err := resource.New(ctx,
|
|
|
|
resource.WithHost(),
|
|
|
|
resource.WithHost(),
|
|
|
|
resource.WithOS(),
|
|
|
|
resource.WithOS(),
|
|
|
|
resource.WithProcess(),
|
|
|
|
resource.WithProcess(),
|
|
|
|