mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 01:38:10 +00:00
Fix timeout parameter bug when querying prometheus API
This commit is contained in:
parent
5b922bee59
commit
634ea02dd8
5 changed files with 239 additions and 61 deletions
|
|
@ -235,7 +235,7 @@ func (h *queryClient) QueryRange(ctx context.Context, r Range, query Selector) (
|
|||
// when present
|
||||
func timeoutFromContext(ctx context.Context) (time.Duration, bool) {
|
||||
if deadline, hasDeadline := ctx.Deadline(); hasDeadline {
|
||||
return time.Since(deadline), true
|
||||
return time.Until(deadline), true
|
||||
}
|
||||
|
||||
return time.Duration(0), false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue