Skip to content

Commit

Permalink
invalidate cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Tulsishah committed Sep 26, 2024
1 parent 98eb566 commit dc6c03a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/storage/caching/fast_stat_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ func (b *fastStatBucket) DeleteObject(
req *gcs.DeleteObjectRequest) (err error) {
b.invalidate(req.Name)
err = b.wrapped.DeleteObject(ctx, req)

return
}

Expand All @@ -344,7 +345,7 @@ func (b *fastStatBucket) DeleteFolder(ctx context.Context, folderName string) er
if err != nil {
return err
}

b.invalidate(folderName)
return err
}

Expand Down
1 change: 1 addition & 0 deletions internal/storage/caching/fast_stat_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ func (t *DeleteFolderTest) Test_DeleteFolder_Success() {
const name = "some-name"
ExpectCall(t.wrapped, "DeleteFolder")(Any(), name).
WillOnce(Return(nil))
ExpectCall(t.cache, "Erase")(name).WillOnce(Return())

err := t.bucket.DeleteFolder(context.TODO(), name)

Expand Down

0 comments on commit dc6c03a

Please sign in to comment.