Исправление некоторых багов
This commit is contained in:
@@ -395,6 +395,12 @@ func (data *SnapshotManagerData) ExtractSnapshot(ctx context.Context, snapshotID
|
||||
|
||||
// If cleanTarget is true, clean the target directory before extraction
|
||||
if cleanTarget {
|
||||
rc, err := zip.OpenReader(blobPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("snapshot archive is corrupted or unreadable, restore aborted to protect data: %w", err)
|
||||
}
|
||||
rc.Close()
|
||||
|
||||
// Remove the directory and recreate it
|
||||
if err := os.RemoveAll(path); err != nil {
|
||||
return fmt.Errorf("failed to clean target directory: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user