diff --git a/daemon/job/active.go b/daemon/job/active.go index b516156..bad9aac 100644 --- a/daemon/job/active.go +++ b/daemon/job/active.go @@ -93,7 +93,7 @@ type activeMode interface { SenderReceiver() (logic.Sender, logic.Receiver) Type() Type PlannerPolicy() logic.PlannerPolicy - RunPeriodic(ctx context.Context, wakeReplication trigger.Trigger + RunPeriodic(ctx context.Context, wakeReplication *trigger.Manual) SnapperReport() *snapper.Report ResetConnectBackoff() } @@ -135,7 +135,7 @@ func (m *modePush) Type() Type { return TypePush } func (m *modePush) PlannerPolicy() logic.PlannerPolicy { return *m.plannerPolicy } -func (m *modePush) RunPeriodic(ctx context.Context, trigger trigger.Trigger { +func (m *modePush) RunPeriodic(ctx context.Context, trigger *trigger.Manual) { m.snapper.Run(ctx, trigger) } @@ -224,7 +224,7 @@ func (*modePull) Type() Type { return TypePull } func (m *modePull) PlannerPolicy() logic.PlannerPolicy { return *m.plannerPolicy } -func (m *modePull) RunPeriodic(ctx context.Context, wakeReplication trigger.Trigger { +func (m *modePull) RunPeriodic(ctx context.Context, wakeReplication *trigger.Manual) { if m.interval.Manual { GetLogger(ctx).Info("manual pull configured, periodic pull disabled") // "waiting for wakeups" is printed in common ActiveSide.do @@ -448,7 +448,6 @@ func (j *ActiveSide) Run(ctx context.Context) { ctx, cancel := context.WithCancel(ctx) defer cancel() - periodicTrigger := trigger.New("periodic") periodCtx, endTask := trace.WithTask(ctx, "periodic") defer endTask() go j.mode.RunPeriodic(periodCtx, periodicTrigger) diff --git a/daemon/job/snapjob.go b/daemon/job/snapjob.go index e591f18..a29db80 100644 --- a/daemon/job/snapjob.go +++ b/daemon/job/snapjob.go @@ -115,7 +115,7 @@ func (j *SnapJob) Run(ctx context.Context) { go j.snapper.Run(periodicCtx, snapshottingTrigger) triggers := trigger.Empty() - triggered, endTask := triggers.Spawn(ctx, []trigger.TriggersnapshottingTrigger, wakeupTrigger}) + triggered, endTask := triggers.Spawn(ctx, []trigger.Trigger{snapshottingTrigger, wakeupTrigger}) defer endTask() invocationCount := 0 diff --git a/daemon/snapper/cron.go b/daemon/snapper/cron.go index 33f521c..d2c6029 100644 --- a/daemon/snapper/cron.go +++ b/daemon/snapper/cron.go @@ -43,7 +43,7 @@ type Cron struct { wakeupWhileRunningCount int } -func (s *Cron) Run(ctx context.Context, snapshotsTaken trigger.Trigger) { +func (s *Cron) Run(ctx context.Context, snapshotsTaken *trigger.Manual) { for { now := time.Now() diff --git a/daemon/snapper/manual.go b/daemon/snapper/manual.go index 9f17a24..850578c 100644 --- a/daemon/snapper/manual.go +++ b/daemon/snapper/manual.go @@ -8,7 +8,7 @@ import ( type manual struct{} -func (s *manual) Run(ctx context.Context, snapshotsTaken trigger.Trigger { +func (s *manual) Run(ctx context.Context, snapshotsTaken *trigger.Manual) { // nothing to do } diff --git a/daemon/snapper/periodic.go b/daemon/snapper/periodic.go index ddf302c..767f04d 100644 --- a/daemon/snapper/periodic.go +++ b/daemon/snapper/periodic.go @@ -52,7 +52,7 @@ type periodicArgs struct { interval time.Duration fsf zfs.DatasetFilter planArgs planArgs - snapshotsTaken *trigger.Trigger + snapshotsTaken *trigger.Manual dryRun bool } @@ -104,7 +104,7 @@ func (s State) sf() state { type updater func(u func(*Periodic)) State type state func(a periodicArgs, u updater) state -func (s *Periodic) Run(ctx context.Context, snapshotsTaken trigger.Trigger { +func (s *Periodic) Run(ctx context.Context, snapshotsTaken *trigger.Manual) { defer trace.WithSpanFromStackUpdateCtx(&ctx)() getLogger(ctx).Debug("start") defer getLogger(ctx).Debug("stop") diff --git a/daemon/snapper/snapper.go b/daemon/snapper/snapper.go index b24894c..b6668e1 100644 --- a/daemon/snapper/snapper.go +++ b/daemon/snapper/snapper.go @@ -18,7 +18,7 @@ const ( ) type Snapper interface { - Run(ctx context.Context, snapshotsTaken trigger.Trigger + Run(ctx context.Context, snapshotsTaken *trigger.Manual) Report() Report }