From 5df2e9a691195946ed4b97e0c444f158fb6ed13d Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 20 Nov 2025 17:41:21 -0800 Subject: [PATCH] fmt --- weed/wdclient/vidmap_client.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/weed/wdclient/vidmap_client.go b/weed/wdclient/vidmap_client.go index e8d3f1316..caa8be99b 100644 --- a/weed/wdclient/vidmap_client.go +++ b/weed/wdclient/vidmap_client.go @@ -78,7 +78,7 @@ func (vc *vidMapClient) LookupFileIdWithFallback(ctx context.Context, fileId str // Use shared lookup logic with batching and singleflight vidLocations, err := vc.LookupVolumeIdsWithFallback(ctx, []string{volumeId}) - + // Check for partial results first (important for multi-volume batched lookups) locations, found := vidLocations[volumeId] if !found || len(locations) == 0 { @@ -88,7 +88,7 @@ func (vc *vidMapClient) LookupFileIdWithFallback(ctx context.Context, fileId str } return nil, fmt.Errorf("volume %s not found for fileId %s", volumeId, fileId) } - + // Volume found successfully - ignore any errors about other volumes // (not relevant for single-volume lookup, but defensive for future batching) @@ -121,13 +121,14 @@ func (vc *vidMapClient) LookupFileIdWithFallback(ctx context.Context, fileId str // - result == nil && err != nil: Complete failure (connection error, etc.) // // Example usage: -// locs, err := mc.LookupVolumeIdsWithFallback(ctx, []string{"1", "2", "999"}) -// if len(locs) > 0 { -// // Process successfully found volumes -// } -// if err != nil { -// // Log/handle failed volumes -// } +// +// locs, err := mc.LookupVolumeIdsWithFallback(ctx, []string{"1", "2", "999"}) +// if len(locs) > 0 { +// // Process successfully found volumes +// } +// if err != nil { +// // Log/handle failed volumes +// } func (vc *vidMapClient) LookupVolumeIdsWithFallback(ctx context.Context, volumeIds []string) (map[string][]Location, error) { result := make(map[string][]Location) var needsLookup []string