Skip to content

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cufee committed Jun 7, 2024
1 parent 6583ccb commit b79646e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cmds/core/scheduler/glossary.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ import (
"golang.org/x/text/language"
)

// CurrentTankAverages

func UpdateAveragesWorker(client core.Client) func() {
// we just run the logic directly as it's not a heavy task and it doesn't matter if it fails
return func() {
log.Info().Msg("updating tank averages cache")

ctx, cancel := context.WithTimeout(context.Background(), time.Minute*1)
defer cancel()

// we just run the logic directly as it's not a heavy task and it doesn't matter if it fails
averages, err := client.Fetch().CurrentTankAverages(ctx)
if err != nil {
log.Err(err).Msg("failed to update averages cache")
Expand All @@ -37,8 +35,8 @@ func UpdateAveragesWorker(client core.Client) func() {
}

func UpdateGlossaryWorker(client core.Client) func() {
// we just run the logic directly as it's not a heavy task and it doesn't matter if it fails
return func() {
// we just run the logic directly as it's not a heavy task and it doesn't matter if it fails
log.Info().Msg("updating glossary cache")

ctx, cancel := context.WithTimeout(context.Background(), time.Second*15)
Expand Down
2 changes: 1 addition & 1 deletion cmds/discord/router/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (r *Router) sendInteractionReply(interaction discordgo.Interaction, state *

err := handler()
if err != nil {
log.Err(err).Any("data", data).Msg("failed to send an interaction response")
log.Err(err).Any("data", data).Str("id", interaction.ID).Stack().Msg("failed to send an interaction response")
return
}
state.acked = true
Expand Down

0 comments on commit b79646e

Please sign in to comment.