Skip to content

Commit

Permalink
Merge pull request #23 from appuio/fix/empty_sample
Browse files Browse the repository at this point in the history
Don't sent empty samples to odoo
  • Loading branch information
TheBigLee authored Jan 3, 2024
2 parents f8eef2d + 4fc8a72 commit 62d5209
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func runQuery(ctx context.Context, odooClient OdooClient, prom PromQuerier, args
return fmt.Errorf("expected prometheus query to return a model.Vector, got %T", res)
}

if samples.Len() == 0 {
return nil
}

var errs error
records := make([]odoo.OdooMeteredBillingRecord, 0, len(samples))
for _, sample := range samples {
Expand Down

0 comments on commit 62d5209

Please sign in to comment.