Skip to content

Commit

Permalink
fixed case where image decryption (not caching) won't be retried if i…
Browse files Browse the repository at this point in the history
…t fails the first time for a specific bucket/manifest.
  • Loading branch information
Neil committed Sep 28, 2010
1 parent 8e5636c commit 373ab30
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -522,7 +522,12 @@ private synchronized void cacheImage(String bucketName, String manifestKey, Stri
ImageCacher imageCacher = imageCachers.putIfAbsent(bucketName + manifestKey, new ImageCacher(bucketName, manifestKey, decryptedImageKey));
if(imageCacher == null) {
if(decryptedImageKey == null) {
decryptedImageKey = decryptImage(bucketName, manifestKey, userId, isAdministrator);
try {
decryptedImageKey = decryptImage(bucketName, manifestKey, userId, isAdministrator);
} catch(EucalyptusCloudException ex) {
imageCachers.remove(bucketName + manifestKey);
throw ex;
}
//decryption worked. Add it.
ImageCacheInfo foundImageCacheInfo = new ImageCacheInfo(bucketName, manifestKey);
foundImageCacheInfo.setImageName(decryptedImageKey);
Expand Down

0 comments on commit 373ab30

Please sign in to comment.