satellite/gracefulexit: use nodecache with gracefulexit

Change-Id: I700caf6dfd06bd3b3970a8cf7c5a79da4af27b5f
This commit is contained in:
Márton Elek 2021-10-25 12:14:59 +02:00 committed by Elek, Márton
parent 98b59fe305
commit fb604be460

View File

@ -343,14 +343,9 @@ func (service *Service) IsOnline(node *NodeDossier) bool {
} }
// FindStorageNodesForGracefulExit searches the overlay network for nodes that meet the provided requirements for graceful-exit requests. // FindStorageNodesForGracefulExit searches the overlay network for nodes that meet the provided requirements for graceful-exit requests.
//
// The main difference between this method and the normal FindStorageNodes is that here we avoid using the cache.
func (service *Service) FindStorageNodesForGracefulExit(ctx context.Context, req FindStorageNodesRequest) (_ []*SelectedNode, err error) { func (service *Service) FindStorageNodesForGracefulExit(ctx context.Context, req FindStorageNodesRequest) (_ []*SelectedNode, err error) {
defer mon.Task()(&ctx)(&err) defer mon.Task()(&ctx)(&err)
if service.config.Node.AsOfSystemTime.Enabled && service.config.Node.AsOfSystemTime.DefaultInterval < 0 { return service.UploadSelectionCache.GetNodes(ctx, req)
req.AsOfSystemInterval = service.config.Node.AsOfSystemTime.DefaultInterval
}
return service.FindStorageNodesWithPreferences(ctx, req, &service.config.Node)
} }
// FindStorageNodesForUpload searches the overlay network for nodes that meet the provided requirements for upload. // FindStorageNodesForUpload searches the overlay network for nodes that meet the provided requirements for upload.