clientv3: include a context in Client

Useful for clean up tasks
This commit is contained in:
Anthony Romano
2016-03-03 12:43:03 -08:00
parent 3b185f130a
commit 360aafec76
8 changed files with 47 additions and 28 deletions

View File

@ -46,7 +46,7 @@ func lockCommandFunc(cmd *cobra.Command, args []string) {
}
func lockUntilSignal(c *clientv3.Client, lockname string) error {
m := concurrency.NewMutex(context.TODO(), c, lockname)
m := concurrency.NewMutex(c, lockname)
ctx, cancel := context.WithCancel(context.TODO())
// unlock in case of ordinary shutdown