[ARVADOS] updated: 8f792a0826d487a7e0f5825e0937c248b072e61d

Git user git at public.curoverse.com
Fri May 13 14:02:14 EDT 2016


Summary of changes:
 services/keepstore/azure_blob_volume.go | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

       via  8f792a0826d487a7e0f5825e0937c248b072e61d (commit)
      from  9011a67f8fc545d62db07a8ab14d5f917b9d6613 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 8f792a0826d487a7e0f5825e0937c248b072e61d
Author: radhika <radhika at curoverse.com>
Date:   Fri May 13 14:01:55 2016 -0400

    8556: SetBlobMetadata with If-Match

diff --git a/services/keepstore/azure_blob_volume.go b/services/keepstore/azure_blob_volume.go
index 55e5a95..c561e03 100644
--- a/services/keepstore/azure_blob_volume.go
+++ b/services/keepstore/azure_blob_volume.go
@@ -378,18 +378,23 @@ func (v *AzureBlobVolume) Trash(loc string) error {
 	} else if time.Since(t) < blobSignatureTTL {
 		return nil
 	}
+
+	// If trashLifetime == 0, just delete it
 	if trashLifetime == 0 {
 		return v.bsClient.DeleteBlob(v.containerName, loc, map[string]string{
 			"If-Match": props.Etag,
 		})
 	}
-	// Mark as trash
+
+	// Otherwise, mark as trash
 	metadata, err := v.bsClient.GetBlobMetadata(v.containerName, loc)
 	if err != nil {
 		return err
 	}
 	metadata["expires_at"] = fmt.Sprintf("%d", time.Now().Add(trashLifetime).Unix())
-	return v.bsClient.SetBlobMetadata(v.containerName, loc, metadata)
+	return v.bsClient.SetBlobMetadata(v.containerName, loc, metadata, map[string]string{
+		"If-Match": props.Etag,
+	})
 }
 
 // Untrash a Keep block.
@@ -406,7 +411,7 @@ func (v *AzureBlobVolume) Untrash(loc string) error {
 
 	// reset expires_at metadata attribute
 	metadata["expires_at"] = ""
-	err = v.bsClient.SetBlobMetadata(v.containerName, loc, metadata)
+	err = v.bsClient.SetBlobMetadata(v.containerName, loc, metadata, nil)
 	return v.translateError(err)
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list