File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,10 @@ func (c *remoteClient) Delete() error {
111
111
func (c * remoteClient ) createLockFile (infoJson []byte ) (int64 , error ) {
112
112
w := c .lockFile ().If (storage.Conditions {DoesNotExist : true }).NewWriter (c .storageContext )
113
113
err := func () error {
114
+ // Add metadata signalling to other clients that heartbeats will be
115
+ // performed on this lock file.
116
+ w .ObjectAttrs .Metadata = map [string ]string {metadataHeaderHeartbeatEnabled : "true" }
117
+
114
118
if _ , err := w .Write (infoJson ); err != nil {
115
119
return err
116
120
}
@@ -121,14 +125,6 @@ func (c *remoteClient) createLockFile(infoJson []byte) (int64, error) {
121
125
return 0 , c .lockError (fmt .Errorf ("writing %q failed: %v" , c .lockFileURL (), err ))
122
126
}
123
127
124
- // Add metadata signalling to other clients that heartbeats will be
125
- // performed on this lock file.
126
- uattrs := storage.ObjectAttrsToUpdate {Metadata : make (map [string ]string )}
127
- uattrs .Metadata [metadataHeaderHeartbeatEnabled ] = "true"
128
- if _ , err := c .lockFile ().Update (c .storageContext , uattrs ); err != nil {
129
- return 0 , c .lockError (err )
130
- }
131
-
132
128
return w .Attrs ().Generation , nil
133
129
}
134
130
You can’t perform that action at this time.
0 commit comments