Skip to content

Commit

Permalink
Delete temporary snapshot when encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed Feb 23, 2014
1 parent b8ba9f5 commit 936ad07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion file_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ func (f *FileSnapshotStore) getSnapshots() ([]*fileSnapshotMeta, error) {
// Ignore any temporary snapshots
dirName := snap.Name()
if strings.HasSuffix(dirName, tmpSuffix) {
f.logger.Printf("[WARN] snapshot: Found temporary snapshot: %v", dirName)
f.logger.Printf("[WARN] snapshot: Found temporary snapshot, removing: %v", dirName)
path := filepath.Join(f.path, dirName)
if err := os.RemoveAll(path); err != nil {
f.logger.Printf("[ERR] snapshot: Failed to remove temporary snapshot %v: %v", path, err)
}
continue
}

Expand Down

0 comments on commit 936ad07

Please sign in to comment.