forked from TrueCloudLab/restic
Merge pull request #688 from restic/fix-686
Save snapshot after saving all pack files
This commit is contained in:
commit
5e48c1fadc
1 changed files with 13 additions and 13 deletions
|
@ -727,19 +727,6 @@ func (arch *Archiver) Snapshot(p *restic.Progress, paths, tags []string, parentI
|
||||||
|
|
||||||
debug.Log("workers terminated")
|
debug.Log("workers terminated")
|
||||||
|
|
||||||
// receive the top-level tree
|
|
||||||
root := (<-resCh).(*restic.Node)
|
|
||||||
debug.Log("root node received: %v", root.Subtree.Str())
|
|
||||||
sn.Tree = root.Subtree
|
|
||||||
|
|
||||||
// save snapshot
|
|
||||||
id, err := arch.repo.SaveJSONUnpacked(restic.SnapshotFile, sn)
|
|
||||||
if err != nil {
|
|
||||||
return nil, restic.ID{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
debug.Log("saved snapshot %v", id.Str())
|
|
||||||
|
|
||||||
// flush repository
|
// flush repository
|
||||||
err = arch.repo.Flush()
|
err = arch.repo.Flush()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -755,6 +742,19 @@ func (arch *Archiver) Snapshot(p *restic.Progress, paths, tags []string, parentI
|
||||||
|
|
||||||
debug.Log("saved indexes")
|
debug.Log("saved indexes")
|
||||||
|
|
||||||
|
// receive the top-level tree
|
||||||
|
root := (<-resCh).(*restic.Node)
|
||||||
|
debug.Log("root node received: %v", root.Subtree.Str())
|
||||||
|
sn.Tree = root.Subtree
|
||||||
|
|
||||||
|
// save snapshot
|
||||||
|
id, err := arch.repo.SaveJSONUnpacked(restic.SnapshotFile, sn)
|
||||||
|
if err != nil {
|
||||||
|
return nil, restic.ID{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
debug.Log("saved snapshot %v", id.Str())
|
||||||
|
|
||||||
return sn, id, nil
|
return sn, id, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue