public Task <GetContentLocationsResponse> GetContentLocationsAsync(GetContentLocationsRequest request)
 {
     return(ExecuteAsync(request, async context =>
     {
         Result <IReadOnlyList <ContentLocationEntry> > result = await _store.GetBulkAsync(context, request.Hashes);
         return result.Select(entries => new GetContentLocationsResponse()
         {
             Entries = entries
         });
     }));
 }
Exemplo n.º 2
0
 /// <inheritdoc />
 public Task <GetContentLocationsResponse> GetContentLocationsAsync(GetContentLocationsRequest request, CallContext callContext = default)
 {
     return(ExecuteAsync(request, callContext, context =>
     {
         return _store.GetBulkAsync(context, request.Hashes)
         .AsAsync(entries => new GetContentLocationsResponse()
         {
             Entries = entries
         });
     },
                         extraEndMessage: r => {
         if (!r.Succeeded)
         {
             var csv = string.Join(",", request.Hashes);
             return $"Hashes=[{csv}]";
         }
         else
         {
             var entries = r.Value.Entries;
             var csv = string.Join(",", request.Hashes.Zip(entries, (hash, entry) => $"{hash}:{entry.Locations.Count}"));
             return $"Hashes=[{csv}]";
         }
     }));
 }