remove noisy log, simplify job interface (#10975)

This commit is contained in:
swayne275 2021-02-22 15:00:24 -07:00 committed by GitHub
parent f33fda0d87
commit 38a647c6e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 12 deletions

View File

@ -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) {

View File

@ -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)

View File

@ -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}})