Converting to structured logging the file jobs/jobs.go (#12120)

Этот коммит содержится в:
Nikhil Ranjan
2019-09-11 20:19:13 +02:00
коммит произвёл Ben Schumacher
родитель 9c3fc4ab9f
Коммит be25dcd6f3

Просмотреть файл

@@ -5,7 +5,6 @@ package jobs
import ( import (
"context" "context"
"fmt"
"time" "time"
"net/http" "net/http"
@@ -135,10 +134,10 @@ func (srv *JobServer) CancellationWatcher(ctx context.Context, jobId string, can
for { for {
select { select {
case <-ctx.Done(): case <-ctx.Done():
mlog.Debug(fmt.Sprintf("CancellationWatcher for Job: %v Aborting as job has finished.", jobId)) mlog.Debug("CancellationWatcher for Job Aborting as job has finished.", mlog.String("job_id", jobId))
return return
case <-time.After(CANCEL_WATCHER_POLLING_INTERVAL * time.Millisecond): case <-time.After(CANCEL_WATCHER_POLLING_INTERVAL * time.Millisecond):
mlog.Debug(fmt.Sprintf("CancellationWatcher for Job: %v polling.", jobId)) mlog.Debug("CancellationWatcher for Job started polling.", mlog.String("job_id", jobId))
if jobStatus, err := srv.Store.Job().Get(jobId); err == nil { if jobStatus, err := srv.Store.Job().Get(jobId); err == nil {
if jobStatus.Status == model.JOB_STATUS_CANCEL_REQUESTED { if jobStatus.Status == model.JOB_STATUS_CANCEL_REQUESTED {
close(cancelChan) close(cancelChan)