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:
Freddy 2022-05-12 17:36:14 -06:00 committed by GitHub
parent 0fa5e7be5a
commit e874b860c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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