etcd: world: Add missing defer

Not sure how this snuck in!
I've now ran a quick grep across the code base, and I can't find any
similar mistakes.

ack '.Done()' | grep -v defer | grep -iv ctx # then check these
This commit is contained in:
James Shubin
2023-08-07 23:00:50 -04:00
parent 00a37b6289
commit 5d84e33be7

View File

@@ -76,7 +76,7 @@ func (obj *World) IdealClusterSizeWatch(ctx context.Context) (chan error, error)
}
util.WgFromCtx(ctx).Add(1)
go func() {
util.WgFromCtx(ctx).Done()
defer util.WgFromCtx(ctx).Done()
// This must get closed *after* because it will not finish until
// the Watcher returns, because it contains a wg.Wait() in it...
defer c.Close() // ignore error