Skip to content

Commit

Permalink
Better error here when Elastic query fails
Browse files Browse the repository at this point in the history
  • Loading branch information
elffjs committed Oct 10, 2024
1 parent d97454d commit d283334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/controllers/rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (r *RewardsController) GetUserRewards(c *fiber.Ctx) error {
integQueryStart := time.Now()
resp, err := r.DataClient.GetIntegrationsMultiple(c.Context(), userDeviceIDs, weekStart, now)
if err != nil {
return err
return fmt.Errorf("failed to grab integration activity data for user vehicles: %w", err)
}
if integQueryDur := time.Since(integQueryStart); integQueryDur >= 5*time.Second {
logger.Info().Msgf("Long integrations query: took %s for %d vehicles.", integQueryDur, len(devices.UserDevices))
Expand Down

0 comments on commit d283334

Please sign in to comment.