Skip to content

Commit

Permalink
fix share jail caching
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Apr 27, 2022
1 parent 2ff32b7 commit 6350f80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/share-jail-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Disable storageprovider cache for the share jail

The share jail should not be cached in the provider cache because it is a virtual collection of resources from different storage providers.

https://github.com/cs3org/reva/pull/2784
6 changes: 4 additions & 2 deletions internal/grpc/services/gateway/storageprovidercache.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ func (c *cachedRegistryClient) ListStorageProviders(ctx context.Context, in *reg

storageID := sdk.DecodeOpaqueMap(in.Opaque)["storage_id"]

key := user.GetId().GetOpaqueId() + storageID
if key != "" {
key := user.GetId().GetOpaqueId() + "!" + storageID
if key != "!" {
s := &registry.ListStorageProvidersResponse{}
if err := pullFromCache(cache, key, s); err == nil {
return s, nil
Expand All @@ -200,6 +200,8 @@ func (c *cachedRegistryClient) ListStorageProviders(ctx context.Context, in *reg
return resp, nil
case storageID == "":
return resp, nil
case storageID == utils.ShareStorageProviderID:
return resp, nil
default:
return resp, pushToCache(cache, key, resp)
}
Expand Down

0 comments on commit 6350f80

Please sign in to comment.