From 38a647c6e5eeecf3c75f93bc1191c72427384f78 Mon Sep 17 00:00:00 2001 From: swayne275 Date: Mon, 22 Feb 2021 15:00:24 -0700 Subject: [PATCH] remove noisy log, simplify job interface (#10975) --- helper/fairshare/fairshare_testing_util.go | 7 +------ helper/fairshare/workerpool.go | 2 -- vault/expiration.go | 4 ---- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/helper/fairshare/fairshare_testing_util.go b/helper/fairshare/fairshare_testing_util.go index e23722363..1f65acd94 100644 --- a/helper/fairshare/fairshare_testing_util.go +++ b/helper/fairshare/fairshare_testing_util.go @@ -14,13 +14,8 @@ type testJob struct { onFail func(error) } -// TODO maybe define these function types -func (t *testJob) GetID() string { - return t.id -} - func (t *testJob) Execute() error { - return t.ex(t.GetID()) + return t.ex(t.id) } func (t *testJob) OnFailure(err error) { diff --git a/helper/fairshare/workerpool.go b/helper/fairshare/workerpool.go index df89a0fc4..3574b131f 100644 --- a/helper/fairshare/workerpool.go +++ b/helper/fairshare/workerpool.go @@ -12,7 +12,6 @@ import ( // Job is an interface for jobs used with this job manager type Job interface { - GetID() string Execute() error OnFailure(err error) } @@ -37,7 +36,6 @@ func (w *worker) start() { w.wg.Done() return case job := <-w.jobCh: - w.logger.Trace("starting new job", "worker", w.name, "job_id", job.GetID()) err := job.Execute() if err != nil { job.OnFailure(err) diff --git a/vault/expiration.go b/vault/expiration.go index 43e521eb5..a6db3e58b 100644 --- a/vault/expiration.go +++ b/vault/expiration.go @@ -161,10 +161,6 @@ func newRevocationJob(nsCtx context.Context, leaseID, nsID string, m *Expiration }, nil } -func (r *revocationJob) GetID() string { - return r.leaseID -} - func (r *revocationJob) Execute() error { metrics.IncrCounterWithLabels([]string{"expire", "lease_expiration"}, 1, []metrics.Label{{"namespace", r.nsID}})