380
func (m *nexusEndpointClient) refreshTableVersion(ctx context.Context) error {
381
for ctx.Err() == nil {
383
>
util.InterruptibleSleep(ctx, backoff.Jitter(m.endpointsRefreshInterval(), 0.2))
384
>
}
385
return ctx.Err()
386
}
387
389
>
// Acquire lock to make sure we are not in the middle of an update.
390
>
m.Lock()
391
>
defer m.Unlock()
392
>
393
>
resp, err := m.persistence.ListNexusEndpoints(ctx, &p.ListNexusEndpointsRequest{
394
>
LastKnownTableVersion: 0,
395
>
PageSize: 0,
396
>
})
397
>
if err != nil || resp.TableVersion != m.tableVersion {
398
m.hasLoadedEndpoints.Store(false)
399
ch := m.tableVersionChanged