cleanup only when source is up

This commit is contained in:
shoopea 2022-06-17 22:03:12 +08:00
parent 28bae81236
commit 23d7d90d20
2 changed files with 8 additions and 6 deletions

6
app.go
View File

@ -681,8 +681,10 @@ func (a AppConfig) CleanupSnapshot() error {
for _, dest := range a.Destinations { for _, dest := range a.Destinations {
if cfg.Box[dest.Box()].online { if cfg.Box[dest.Box()].online {
for _, src := range a.Sources { for _, src := range a.Sources {
cleanupSnapshot[src.Box()] = cleanupSnapshot[src.Box()] + " " + src.Path() if cfg.Box[src.Box()].online {
cleanupSnapshot[dest.Box()] = cleanupSnapshot[dest.Box()] + " " + dest.Path() + "/" + src.Box() + "/" + src.Path() cleanupSnapshot[src.Box()] = cleanupSnapshot[src.Box()] + " " + src.Path()
cleanupSnapshot[dest.Box()] = cleanupSnapshot[dest.Box()] + " " + dest.Path() + "/" + src.Box() + "/" + src.Path()
}
} }
} }
} }

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 = "93169ff" var githash = "28bae81"
var buildstamp = "2022-06-17_13:57:23" var buildstamp = "2022-06-17_14:02:53"
var commits = "38" var commits = "39"
var version = "93169ff-b38 - 2022-06-17_13:57:23" var version = "28bae81-b39 - 2022-06-17_14:02:53"