crash fix for offline boxes
This commit is contained in:
parent
138786855f
commit
88220d47e6
28
app.go
28
app.go
@ -172,20 +172,22 @@ func (a *App) Cleanup(now time.Time) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, dest := range a.destinations {
|
for _, dest := range a.destinations {
|
||||||
dest = dest.Append("/" + src.Box() + "/" + src.Path())
|
if cfg.box[dest.Box()].online {
|
||||||
for _, s := range cfg.box[dest.Box()].zfs.filesystems[dest.Path()].snapshots {
|
dest = dest.Append("/" + src.Box() + "/" + src.Path())
|
||||||
if !s.Valid() {
|
for _, s := range cfg.box[dest.Box()].zfs.filesystems[dest.Path()].snapshots {
|
||||||
if err := s.Delete(); err != nil {
|
if !s.Valid() {
|
||||||
log.WithFields(log.Fields{"app": a.name, "now": now, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("")
|
if err := s.Delete(); err != nil {
|
||||||
return err
|
log.WithFields(log.Fields{"app": a.name, "now": now, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("")
|
||||||
}
|
return err
|
||||||
} else if expired, err := s.Expired(now); err != nil {
|
}
|
||||||
log.WithFields(log.Fields{"app": a.name, "now": now, "box": dest.Box(), "snapshot": s.String(), "call": "Expired", "error": err}).Errorf("")
|
} else if expired, err := s.Expired(now); err != nil {
|
||||||
return err
|
log.WithFields(log.Fields{"app": a.name, "now": now, "box": dest.Box(), "snapshot": s.String(), "call": "Expired", "error": err}).Errorf("")
|
||||||
} else if expired {
|
|
||||||
if err := s.Delete(); err != nil {
|
|
||||||
log.WithFields(log.Fields{"app": a.name, "now": now, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("")
|
|
||||||
return err
|
return err
|
||||||
|
} else if expired {
|
||||||
|
if err := s.Delete(); err != nil {
|
||||||
|
log.WithFields(log.Fields{"app": a.name, "now": now, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("")
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||||
package main
|
package main
|
||||||
var githash = "2afd699"
|
var githash = "1387868"
|
||||||
var branch = "v2"
|
var branch = "v2"
|
||||||
var buildstamp = "2023-07-31_08:29:23"
|
var buildstamp = "2023-07-31_08:33:33"
|
||||||
var commits = "68"
|
var commits = "69"
|
||||||
var version = "2afd699-b68 - 2023-07-31_08:29:23"
|
var version = "1387868-b69 - 2023-07-31_08:33:33"
|
||||||
|
Loading…
Reference in New Issue
Block a user