Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix caching #3700

Merged
merged 3 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-caching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix caching

Do not cache files that are in processing.

https://github.com/cs3org/reva/pull/3700
2 changes: 2 additions & 0 deletions internal/grpc/services/gateway/storageprovidercache.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ func (c *cachedAPIClient) Stat(ctx context.Context, in *provider.StatRequest, op
// we do not know when to invalidate them
// FIXME: find a way to cache/invalidate them too
return resp, nil
case utils.ReadPlainFromOpaque(resp.GetInfo().GetOpaque(), "status") == "processing":
return resp, nil
default:
return resp, c.statCache.PushToCache(key, resp)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/utils/decomposedfs/decomposedfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ func (fs *Decomposedfs) Postprocessing(ch <-chan events.Event) {
}
}

upload.Cleanup(up, failed, keepUpload)

// remove cache entry in gateway
fs.cache.RemoveStat(ev.ExecutingUser.GetId(), &provider.ResourceId{SpaceId: n.SpaceID, OpaqueId: n.ID})

upload.Cleanup(up, failed, keepUpload)

if err := events.Publish(
fs.stream,
events.UploadReady{
Expand Down