Skip to content

Commit

Permalink
Filter providers only if the request is mad for listing the root folder
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Nov 9, 2021
1 parent b0fd276 commit 681d371
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/grpc/services/gateway/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,12 @@ func (s *svc) listContainerAcrossProviders(ctx context.Context, req *provider.Li
nestedInfos := make(map[string]*provider.ResourceInfo)
log := appctx.GetLogger(ctx)

for _, p := range s.filterProvidersByUserAgent(ctx, providers) {
if req.Ref.GetPath() == "/" {
// filter the content of the folder only if the request folder is the root
providers = s.filterProvidersByUserAgent(ctx, providers)
}

for _, p := range providers {
c, err := s.getStorageProviderClient(ctx, p)
if err != nil {
log.Err(err).Msg("error connecting to storage provider=" + p.Address)
Expand Down

0 comments on commit 681d371

Please sign in to comment.