mirror of
https://github.com/zrepl/zrepl.git
synced 2024-12-22 23:20:51 +01:00
Inlined a couple legacy leftover functions from the mode copypasta
This commit is contained in:
parent
b79ad3ddc3
commit
e9564a7e5c
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user