Mercurial > gemma
comparison pkg/imports/queue.go @ 5722:0542aec69375
Be more verbose about do errors in scheduler.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 29 May 2024 12:44:36 +0200 |
parents | 6270951dda28 |
children | 4c8652a61eab |
comparison
equal
deleted
inserted
replaced
5716:61eff98a40ae | 5722:0542aec69375 |
---|---|
416 names[i] = string(kind) | 416 names[i] = string(kind) |
417 i++ | 417 i++ |
418 } | 418 } |
419 // XXX: Consider using sort.Strings to make output deterministic. | 419 // XXX: Consider using sort.Strings to make output deterministic. |
420 return names | 420 return names |
421 } | |
422 | |
423 // String implements [fmt/Stringer]. | |
424 func (idj *idJob) String() string { | |
425 return fmt.Sprintf("job %s [%d]", idj.kind, idj.id) | |
421 } | 426 } |
422 | 427 |
423 func (idj *idJob) nextRetry(feedback Feedback) bool { | 428 func (idj *idJob) nextRetry(feedback Feedback) bool { |
424 switch { | 429 switch { |
425 case idj.waitRetry.Status != pgtype.Present && !idj.triesLeft.Valid: | 430 case idj.waitRetry.Status != pgtype.Present && !idj.triesLeft.Valid: |
1042 } | 1047 } |
1043 | 1048 |
1044 var errCleanup error | 1049 var errCleanup error |
1045 if !retry { // cleanup debris | 1050 if !retry { // cleanup debris |
1046 if errCleanup = survive(job.CleanUp)(); errCleanup != nil { | 1051 if errCleanup = survive(job.CleanUp)(); errCleanup != nil { |
1047 feedback.Error("error cleanup: %v", errCleanup) | 1052 feedback.Error("error cleanup: %v %v", idj, errCleanup) |
1048 } | 1053 } |
1049 } | 1054 } |
1050 | 1055 |
1051 var remove bool | 1056 var remove bool |
1052 if remover, ok := jc.(JobRemover); ok { | 1057 if remover, ok := jc.(JobRemover); ok { |