From e9564a7e5c96865d62bfa5c636fdb38f9dda7c54 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Wed, 21 Nov 2018 14:35:40 +0100 Subject: [PATCH] Inlined a couple legacy leftover functions from the mode copypasta --- daemon/job/snapjob.go | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/daemon/job/snapjob.go b/daemon/job/snapjob.go index 173d7db..2e0034f 100644 --- a/daemon/job/snapjob.go +++ b/daemon/job/snapjob.go @@ -28,21 +28,8 @@ type SnapJob struct { func (j *SnapJob) Name() string { return j.name } -func (j *SnapJob) getPruner(ctx context.Context, sender *endpoint.Sender) *pruner.Pruner { - p := j.prunerFactory.BuildSinglePruner(ctx, sender, sender) - return p -} - func (j *SnapJob) Type() Type { return TypeSnap } -func (j *SnapJob) RunPeriodic(ctx context.Context, wakeUpCommon chan<- struct{}) { - j.snapper.Run(ctx, wakeUpCommon) -} - -func (j *SnapJob) FSFilter() zfs.DatasetFilter { - return j.fsfilter -} - func snapJob(g *config.Global, in *config.SnapJob) (j *SnapJob, err error) { j = &SnapJob{} fsf, err := filters.DatasetMapFilterFromConfig(in.Filesystems) @@ -95,7 +82,7 @@ func (j *SnapJob) Run(ctx context.Context) { periodicDone := make(chan struct{}) ctx, cancel := context.WithCancel(ctx) defer cancel() - go j.RunPeriodic(ctx, periodicDone) + go j.snapper.Run(ctx, periodicDone) invocationCount := 0 outer: @@ -118,8 +105,8 @@ outer: func (j *SnapJob) doPrune(ctx context.Context) { log := GetLogger(ctx) ctx = logging.WithSubsystemLoggers(ctx, log) - sender := endpoint.NewSender(j.FSFilter()) - j.pruner = j.getPruner(ctx, sender) + sender := endpoint.NewSender(j.fsfilter) + j.pruner = j.prunerFactory.BuildSinglePruner(ctx, sender, sender) log.Info("start pruning") j.pruner.Prune() log.Info("finished pruning")