Release the chunk used to download files when finished

Without this fix, a chunk is leaked for each snapshot checked
with `-files`.
This commit is contained in:
Gilbert Chen
2022-12-06 22:46:25 -05:00
parent 58f0d2be5a
commit b8c7594dbf

View File

@@ -1338,6 +1338,10 @@ func (manager *SnapshotManager) VerifySnapshot(snapshot *Snapshot) bool {
LOG_TRACE("SNAPSHOT_VERIFY", "%s", file.Path) LOG_TRACE("SNAPSHOT_VERIFY", "%s", file.Path)
} }
if lastChunk != nil {
manager.config.PutChunk(lastChunk)
}
if corruptedFiles > 0 { if corruptedFiles > 0 {
LOG_WARN("SNAPSHOT_VERIFY", "Snapshot %s at revision %d contains %d corrupted files", LOG_WARN("SNAPSHOT_VERIFY", "Snapshot %s at revision %d contains %d corrupted files",
snapshot.ID, snapshot.Revision, corruptedFiles) snapshot.ID, snapshot.Revision, corruptedFiles)