Добавлена возможность зарегистрировать локальный снапшот

This commit is contained in:
2025-10-30 01:36:21 +03:00
parent f34539c06b
commit cd98d1f4a2
5 changed files with 110 additions and 1196 deletions

View File

@@ -444,8 +444,8 @@ type diffArchiveReader struct {
// Close closes the file and removes the temporary archive and staging directory.
func (r *diffArchiveReader) Close() error {
err := r.File.Close()
os.Remove(r.tempArchive)
os.RemoveAll(r.tempStaging)
_ = os.Remove(r.tempArchive)
_ = os.RemoveAll(r.tempStaging)
return err
}
@@ -517,8 +517,8 @@ func (data *SnapshotManagerData) createDiffArchive(ctx context.Context, snapshot
tempArchivePath := filepath.Join(data.blobStore.GetBaseDir(), "diff-"+snapshotID+".zip")
if err := archive.CreateArchive(tempStagingDir, tempArchivePath); err != nil {
os.RemoveAll(tempStagingDir)
os.Remove(tempArchivePath)
_ = os.RemoveAll(tempStagingDir)
_ = os.Remove(tempArchivePath)
return "", "", fmt.Errorf("failed to create diff archive: %w", err)
}