another fix to aggregation reports
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-23 10:11:14 +11:00
parent 3e2d95d3b9
commit 3671860b7d
3 changed files with 19 additions and 10 deletions

View File

@@ -40,14 +40,13 @@ func (h *Handler) SnapshotAggregateForce(w http.ResponseWriter, r *http.Request)
}
if granularity != "" && snapshotType != "monthly" {
h.Logger.Warn("Snapshot aggregation granularity supplied for non-monthly request",
h.Logger.Debug("Snapshot aggregation ignoring granularity for non-monthly request",
"type", snapshotType,
"granularity", granularity,
)
writeJSONError(w, http.StatusBadRequest, "granularity is only supported for monthly aggregation")
return
granularity = ""
}
if granularity != "" && granularity != "hourly" && granularity != "daily" {
if snapshotType == "monthly" && granularity != "" && granularity != "hourly" && granularity != "daily" {
h.Logger.Warn("Snapshot aggregation invalid granularity", "granularity", granularity)
writeJSONError(w, http.StatusBadRequest, "granularity must be hourly or daily")
return