Skip to content

Commit 59dad38

Browse files
authored
Merge pull request ActiveState#3665 from ActiveState/mitchell/dx-3213-2
Do not assume all depot artifacts are cached yet.
2 parents e2d7b3d + 68b8961 commit 59dad38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/runtime/depot.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,12 @@ func (d *depot) Save() error {
422422
// Mark artifacts that are no longer used and remove the old ones.
423423
for id := range d.artifacts {
424424
if deployments, ok := d.config.Deployments[id]; !ok || len(deployments) == 0 {
425+
if _, exists := d.config.Cache[id]; !exists {
426+
err := d.recordUse(id)
427+
if err != nil {
428+
return errs.Wrap(err, "Could not update depot cache with previously used artifact")
429+
}
430+
}
425431
d.config.Cache[id].InUse = false
426432
logging.Debug("Artifact '%s' is no longer in use", id.String())
427433
}

0 commit comments

Comments
 (0)