Skip to content

Commit 9328c5f

Browse files
authored
Merge pull request #2042 from EtienneBruines/patch-2
fix: timeout issues for list.peerings
2 parents 1adb94d + 6e315fe commit 9328c5f

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

dependency/consul_peering.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@ func (l *ListPeeringQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interf
9999
RawQuery: opts.String(),
100100
})
101101

102-
// list peering is a blocking API, so making sure the ctx passed while calling it
103-
// times out after the default wait time.
104-
ctx, cancel := context.WithTimeout(context.Background(), DefaultContextTimeout)
105-
defer cancel()
106-
107-
p, meta, err := clients.Consul().Peerings().List(ctx, opts.ToConsulOpts())
102+
p, meta, err := clients.Consul().Peerings().List(context.Background(), opts.ToConsulOpts())
108103
if err != nil {
109104
return nil, nil, errors.Wrap(err, l.String())
110105
}

dependency/dependency.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ const (
4444
TypeNomad
4545
)
4646

47-
const (
48-
// DefaultContextTimeout context wait timeout for blocking queries.
49-
DefaultContextTimeout = 60 * time.Second
50-
)
51-
5247
// Dependency is an interface for a dependency that Consul Template is capable
5348
// of watching.
5449
type Dependency interface {

0 commit comments

Comments
 (0)