mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 13:55:55 +00:00
Actually block when syncing subscriptions (#13066)
By changing to use WatchCtx we will actually block for changes to the peering list. WatchCh creates a goroutine to collect errors from WatchCtx and returns immediately. The existing behavior wouldn't result in a tight loop because of the rate limiting in the surrounding function, but it would still lead to more work than is necessary.
This commit is contained in:
parent
0fa5e7be5a
commit
e874b860c0
@ -134,7 +134,7 @@ func (m *subscriptionManager) syncSubscriptionsAndBlock(ctx context.Context, pee
|
||||
}
|
||||
|
||||
// Block for any changes to the state store.
|
||||
ws.WatchCh(ctx)
|
||||
ws.WatchCtx(ctx)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user