jobqueue: improve logging
Add job ID where it's missing
This commit is contained in:
parent
9c6438c8f4
commit
df73b835c3
2 changed files with 2 additions and 2 deletions
|
|
@ -87,7 +87,7 @@ func WatchJob(ctx context.Context, job worker.Job) {
|
|||
// Requests and runs 1 job of specified type(s)
|
||||
// Returning an error here will result in the worker backing off for a while and retrying
|
||||
func RequestAndRunJob(client *worker.Client, acceptedJobTypes []string, jobImpls map[string]JobImplementation) error {
|
||||
logrus.Info("Waiting for a new job...")
|
||||
logrus.Debug("Waiting for a new job...")
|
||||
job, err := client.RequestJob(acceptedJobTypes, common.CurrentArch())
|
||||
if err == worker.ErrClientRequestJobTimeout {
|
||||
logrus.Debugf("Requesting job timed out: %v", err)
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ func (q *dbJobQueue) FinishJob(id uuid.UUID, result interface{}) error {
|
|||
defer func() {
|
||||
err = tx.Rollback(context.Background())
|
||||
if err != nil && !errors.As(err, &pgx.ErrTxClosed) {
|
||||
logrus.Error("error rolling back finish job transaction: ", err)
|
||||
logrus.Errorf("error rolling back finish job transaction for job %s: %v", id, err)
|
||||
}
|
||||
|
||||
}()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue