Skip to content

Commit

Permalink
Use full blob key when touch object in the cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
ekharkunov committed Dec 2, 2024
1 parent 4871857 commit 77cc3d9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ public boolean exists(String key) {

@Override
public void touch(String key) {
Blob blob = storage.get(this.bucketName, getBlobKey(key));
String fullKey = getBlobKey(key);
Blob blob = storage.get(this.bucketName, fullKey);
if (blob != null) {
try {
// metadata can be updated only by copying object to itself
blob.copyTo(this.bucketName, key);
blob.copyTo(this.bucketName, fullKey);
} catch (StorageException exc) {
LOGGER.warn(String.format("Exception when touch object '%s' %s", key, exc.getReason()));
LOGGER.warn(String.format("Exception when touch object '%s' %s", fullKey, exc.getReason()));
}
}
}
Expand Down

0 comments on commit 77cc3d9

Please sign in to comment.