Skip to content

Commit 07cff46

Browse files
committed
introducing old location var to be able to clear
location MD field Issue: BB-699
1 parent 32781bf commit 07cff46

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

extensions/lifecycle/tasks/LifecycleUpdateExpirationTask.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ class LifecycleUpdateExpirationTask extends BackbeatTask {
185185
coldLocation, startTime - restoreExpirationDate);
186186

187187
// Reset archive flags to no longer show it as restored
188+
const oldLocation = objMD.getLocation();
189+
objMD.setLocation();
188190
objMD.setArchive({
189191
archiveInfo: archive.archiveInfo,
190192
});
@@ -196,11 +198,11 @@ class LifecycleUpdateExpirationTask extends BackbeatTask {
196198
return this._putMetadata(entry, objMD, log, err => {
197199
LifecycleMetrics.onLifecycleCompleted(log, 'restore:delete',
198200
coldLocation, Date.now() - restoreExpirationDate);
199-
next(err, objMD);
201+
next(err, objMD, oldLocation);
200202
});
201203
},
202-
(objMD, next) => this._garbageCollectLocation(
203-
entry, objMD.getLocation(), log, next,
204+
(objMD, oldLocation, next) => this._garbageCollectLocation(
205+
entry, oldLocation, log, next,
204206
),
205207
], done);
206208
}

0 commit comments

Comments
 (0)