diff --git a/daemon/snapper/snapper.go b/daemon/snapper/snapper.go index 2071389..8a6d811 100644 --- a/daemon/snapper/snapper.go +++ b/daemon/snapper/snapper.go @@ -74,7 +74,7 @@ const ( Planning Snapshotting Waiting - Error + ErrorWait ) func (s State) sf() state { @@ -83,7 +83,7 @@ func (s State) sf() state { Planning: plan, Snapshotting: snapshot, Waiting: wait, - Error: nil, + ErrorWait: wait, } return m[s] } @@ -163,7 +163,7 @@ func (s *Snapper) Run(ctx context.Context, snapshotsTaken chan<- struct{}) { func onErr(err error, u updater) state { return u(func(s *Snapper) { s.err = err - s.state = Error + s.state = ErrorWait }).sf() } @@ -254,13 +254,15 @@ func snapshot(a args, u updater) state { select { case a.snapshotsTaken <- struct{}{}: default: - a.log.Warn("callback channel is full, discarding snapshot update event") + if a.snapshotsTaken != nil { + a.log.Warn("callback channel is full, discarding snapshot update event") + } } return u(func(snapper *Snapper) { if hadErr { - snapper.state = Error - snapper.err = errors.New("one or more snapshots could not be created") + snapper.state = ErrorWait + snapper.err = errors.New("one or more snapshots could not be created, check logs for details") } else { snapper.state = Waiting } diff --git a/daemon/snapper/state_string.go b/daemon/snapper/state_string.go index 485e7d9..136baf5 100644 --- a/daemon/snapper/state_string.go +++ b/daemon/snapper/state_string.go @@ -8,7 +8,7 @@ const ( _State_name_0 = "SyncUpPlanning" _State_name_1 = "Snapshotting" _State_name_2 = "Waiting" - _State_name_3 = "Error" + _State_name_3 = "ErrorWait" ) var (