mirror of
https://github.com/zrepl/zrepl.git
synced 2025-01-24 15:19:36 +01:00
Gofmt snapjob.go
This commit is contained in:
parent
22d9830baa
commit
d0f898751f
@ -26,18 +26,16 @@ type SnapJob struct {
|
|||||||
pruner *pruner.Pruner
|
pruner *pruner.Pruner
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (j *SnapJob) Name() string { return j.name }
|
func (j *SnapJob) Name() string { return j.name }
|
||||||
|
|
||||||
func (j *SnapJob) getPruner(ctx context.Context, sender *endpoint.Sender) (*pruner.Pruner) {
|
func (j *SnapJob) getPruner(ctx context.Context, sender *endpoint.Sender) *pruner.Pruner {
|
||||||
p := j.prunerFactory.BuildSinglePruner(ctx,sender,sender)
|
p := j.prunerFactory.BuildSinglePruner(ctx, sender, sender)
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (j *SnapJob) Type() Type { return TypeSnap }
|
func (j *SnapJob) Type() Type { return TypeSnap }
|
||||||
|
|
||||||
func (j *SnapJob) RunPeriodic(ctx context.Context, wakeUpCommon chan <- struct{}) {
|
func (j *SnapJob) RunPeriodic(ctx context.Context, wakeUpCommon chan<- struct{}) {
|
||||||
j.snapper.Run(ctx, wakeUpCommon)
|
j.snapper.Run(ctx, wakeUpCommon)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +60,7 @@ func snapJob(g *config.Global, in *config.SnapJob) (j *SnapJob, err error) {
|
|||||||
Subsystem: "pruning",
|
Subsystem: "pruning",
|
||||||
Name: "time",
|
Name: "time",
|
||||||
Help: "seconds spent in pruner",
|
Help: "seconds spent in pruner",
|
||||||
ConstLabels: prometheus.Labels{"zrepl_job":j.name},
|
ConstLabels: prometheus.Labels{"zrepl_job": j.name},
|
||||||
}, []string{"prune_side"})
|
}, []string{"prune_side"})
|
||||||
j.prunerFactory, err = pruner.NewSinglePrunerFactory(in.Pruning, j.promPruneSecs)
|
j.prunerFactory, err = pruner.NewSinglePrunerFactory(in.Pruning, j.promPruneSecs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -126,4 +124,3 @@ func (j *SnapJob) doPrune(ctx context.Context) {
|
|||||||
j.pruner.Prune()
|
j.pruner.Prune()
|
||||||
log.Info("finished pruning")
|
log.Info("finished pruning")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user