From 41d56eb90ad8f4a4b0494c25badf5dde53363c31 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 21 May 2022 23:22:39 +0800 Subject: [PATCH] go straight to last snapshot --- app.go | 10 ++++------ version.go | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app.go b/app.go index 483c6fa..e60929f 100644 --- a/app.go +++ b/app.go @@ -594,9 +594,9 @@ func (a AppConfig) SendSnapshots() (err error) { ) sNextSnapshot = sFirstSnapshot isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot) - for !isLastSnapshot { + if !isLastSnapshot { sCurrSnapshot = sNextSnapshot - sNextSnapshot, err = cfg.Box[src.Box()].ZFSGetNextSnapshot(sNextSnapshot) + sNextSnapshot, err = cfg.Box[src.Box()].ZFSGetLastSnapshot(sNextSnapshot.Path()) if *debugFlag { 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 } - isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot) } if *debugFlag { 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:]) isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot) - for !isLastSnapshot { + if !isLastSnapshot { sCurrSnapshot = sNextSnapshot - sNextSnapshot, err = cfg.Box[src.Box()].ZFSGetNextSnapshot(sNextSnapshot) + sNextSnapshot, err = cfg.Box[src.Box()].ZFSGetLastSnapshot(sNextSnapshot.Path()) if *debugFlag { 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 } - isLastSnapshot, _ = cfg.Box[src.Box()].ZFSIsLastSnapshot(sNextSnapshot) } } } diff --git a/version.go b/version.go index c4483ab..a493389 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,6 @@ // Code generated by version.sh (@generated) DO NOT EDIT. package main -var githash = "ed26114" -var buildstamp = "2022-04-16_13:30:39" -var commits = "32" -var version = "ed26114-b32 - 2022-04-16_13:30:39" +var githash = "2ae1737" +var buildstamp = "2022-05-21_15:22:30" +var commits = "33" +var version = "2ae1737-b33 - 2022-05-21_15:22:30"