go straight to last snapshot

This commit is contained in:
shoopea 2022-05-21 23:22:39 +08:00
parent 2ae1737081
commit 41d56eb90a
2 changed files with 8 additions and 10 deletions

10
app.go
View File

@ -594,9 +594,9 @@ func (a AppConfig) SendSnapshots() (err error) {
) )
sNextSnapshot = sFirstSnapshot sNextSnapshot = sFirstSnapshot
isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot) isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot)
for !isLastSnapshot { if !isLastSnapshot {
sCurrSnapshot = sNextSnapshot sCurrSnapshot = sNextSnapshot
sNextSnapshot, err = cfg.Box[src.Box()].ZFSGetNextSnapshot(sNextSnapshot) sNextSnapshot, err = cfg.Box[src.Box()].ZFSGetLastSnapshot(sNextSnapshot.Path())
if *debugFlag { if *debugFlag {
log.Printf("AppConfig.SendSnapshots : %s : Sending incrementally %s to %s", a.Name, string(sNextSnapshot), dest.Box()) log.Printf("AppConfig.SendSnapshots : %s : Sending incrementally %s to %s", a.Name, string(sNextSnapshot), dest.Box())
} }
@ -610,7 +610,6 @@ func (a AppConfig) SendSnapshots() (err error) {
} }
return return
} }
isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot)
} }
if *debugFlag { if *debugFlag {
log.Printf("AppConfig.SendSnapshots : %s : All snapshots sent for %s", a.Name, string(src)) log.Printf("AppConfig.SendSnapshots : %s : All snapshots sent for %s", a.Name, string(src))
@ -626,9 +625,9 @@ func (a AppConfig) SendSnapshots() (err error) {
) )
sNextSnapshot = Snapshot(string(dLastSnapshot)[len(dest.Path())+len(src.Box())+2:]) sNextSnapshot = Snapshot(string(dLastSnapshot)[len(dest.Path())+len(src.Box())+2:])
isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot) isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot)
for !isLastSnapshot { if !isLastSnapshot {
sCurrSnapshot = sNextSnapshot sCurrSnapshot = sNextSnapshot
sNextSnapshot, err = cfg.Box[src.Box()].ZFSGetNextSnapshot(sNextSnapshot) sNextSnapshot, err = cfg.Box[src.Box()].ZFSGetLastSnapshot(sNextSnapshot.Path())
if *debugFlag { if *debugFlag {
log.Printf("AppConfig.SendSnapshots : %s : Sending incrementally %s to %s", a.Name, string(sNextSnapshot), dest.Box()) log.Printf("AppConfig.SendSnapshots : %s : Sending incrementally %s to %s", a.Name, string(sNextSnapshot), dest.Box())
} }
@ -642,7 +641,6 @@ func (a AppConfig) SendSnapshots() (err error) {
} }
return return
} }
isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot)
} }
} }
} }

View File

@ -1,6 +1,6 @@
// Code generated by version.sh (@generated) DO NOT EDIT. // Code generated by version.sh (@generated) DO NOT EDIT.
package main package main
var githash = "ed26114" var githash = "2ae1737"
var buildstamp = "2022-04-16_13:30:39" var buildstamp = "2022-05-21_15:22:30"
var commits = "32" var commits = "33"
var version = "ed26114-b32 - 2022-04-16_13:30:39" var version = "2ae1737-b33 - 2022-05-21_15:22:30"