Skip to content

Commit

Permalink
remove noisy log, simplify job interface (hashicorp#10975)
Browse files Browse the repository at this point in the history
  • Loading branch information
swayne275 committed Feb 22, 2021
1 parent eed7f97 commit 1831dbf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions helper/fairshare/fairshare_testing_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions helper/fairshare/workerpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions vault/expiration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}})

Expand Down

0 comments on commit 1831dbf

Please sign in to comment.