another fix to aggregation reports
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user