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:
James Bardin 2017-07-17 11:28:45 -04:00
parent 7584ac1247
commit 1070d04b07
2 changed files with 2 additions and 9 deletions

View File

@ -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() {

View File

@ -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
}