Remove consul context adapter for RenewPeriodic
Updated the vendored consul which no longer requires the channel adapter to convert a `chan stuct{}` to a `<-chan struct{}`. Call testutil.NewTestServerConfigT with the new signature.
This commit is contained in:
parent
7584ac1247
commit
1070d04b07
|
@ -22,7 +22,7 @@ func newConsulTestServer(t *testing.T) *testutil.TestServer {
|
|||
t.Skip()
|
||||
}
|
||||
|
||||
srv := testutil.NewTestServerConfig(t, func(c *testutil.TestServerConfig) {
|
||||
srv, _ := testutil.NewTestServerConfigT(t, func(c *testutil.TestServerConfig) {
|
||||
c.LogLevel = "warn"
|
||||
|
||||
if !testing.Verbose() {
|
||||
|
|
|
@ -367,14 +367,7 @@ func (c *RemoteClient) createSession() (string, error) {
|
|||
log.Println("[INFO] created consul lock session", id)
|
||||
|
||||
// keep the session renewed
|
||||
// we need an adapter to convert the session Done() channel to a
|
||||
// non-directional channel to satisfy the RenewPeriodic signature.
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
close(done)
|
||||
}()
|
||||
go session.RenewPeriodic(lockSessionTTL, id, nil, done)
|
||||
go session.RenewPeriodic(lockSessionTTL, id, nil, ctx.Done())
|
||||
|
||||
return id, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue