Backfill: Do not query after --end (#9340)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
7ff76ed1ab
commit
bd217c58a7
|
@ -105,11 +105,15 @@ func (importer *ruleImporter) importRule(ctx context.Context, ruleExpr, ruleName
|
|||
for startWithAlignment.Unix() < currStart {
|
||||
startWithAlignment = startWithAlignment.Add(grp.Interval())
|
||||
}
|
||||
end := time.Unix(min(endOfBlock/int64(time.Second/time.Millisecond), end.Unix()), 0).UTC()
|
||||
if end.Before(startWithAlignment) {
|
||||
break
|
||||
}
|
||||
val, warnings, err := importer.apiClient.QueryRange(ctx,
|
||||
ruleExpr,
|
||||
v1.Range{
|
||||
Start: startWithAlignment,
|
||||
End: time.Unix(min(endOfBlock/int64(time.Second/time.Millisecond), end.Unix()), 0).UTC(),
|
||||
End: end,
|
||||
Step: grp.Interval(),
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue