366
}
367
368
>
func (r *EndpointRegistryImpl) getAllEndpointsMatchingWithPersistenceFallback(ctx context.Context) (int64, []*persistencespb.NexusEndpointEntry, error) {
endpoint_registry.go
369
>
tableVersion, endpoints, err := r.getAllEndpointsMatching(ctx)
370
>
if err != nil {
371
// Fallback to persistence on matching error during initial load.
372
r.logger.Error("error from matching when initializing Nexus endpoint cache", tag.Error(err))
373
tableVersion, endpoints, err = r.getAllEndpointsPersistence(ctx)
374
}
376
}
377
378
// getAllEndpointsMatching paginates over all endpoints returned by matching. It always does a simple get.
379
>
func (r *EndpointRegistryImpl) getAllEndpointsMatching(ctx context.Context) (int64, []*persistencespb.NexusEndpointEntry, error) {
endpoint_registry.go
380
>
return r.getAllEndpoints(ctx, func(currentTableVersion int64, currentPageToken []byte) (int64, []byte, []*persistencespb.NexusEndpointEntry, error) {
381
>
resp, err := r.matchingClient.ListNexusEndpoints(ctx, &matchingservice.ListNexusEndpointsRequest{
382
>
NextPageToken: currentPageToken,
383
>
PageSize: int32(r.config.refreshPageSize()),
384
>
LastKnownTableVersion: currentTableVersion,
385
>
Wait: false,
386
>
})
387
>
if err != nil {
388
return 0, nil, nil, err
389
}