server/requestJob: failing to read job status is fatal
Error out early in case reading a job status fails. The state would otherwise be inconsistent if only some of the job statuses have been read out.
This commit is contained in:
parent
a8adb59995
commit
ac642c3d70
1 changed files with 6 additions and 1 deletions
|
|
@ -452,13 +452,18 @@ func (s *Server) requestJob(ctx context.Context, arch string, jobTypes []string,
|
|||
jobType, status, _, err := s.jobStatus(jobId, nil)
|
||||
if err != nil {
|
||||
logrus.Errorf("error retrieving job status: %v", err)
|
||||
return
|
||||
} else {
|
||||
prometheus.DequeueJobMetrics(status.Queued, status.Started, jobType)
|
||||
}
|
||||
|
||||
for _, depID := range depIDs {
|
||||
// TODO: include type of arguments
|
||||
_, result, _, _, _, _, _, _ := s.jobs.JobStatus(depID)
|
||||
var result json.RawMessage
|
||||
_, result, _, _, _, _, _, err = s.jobs.JobStatus(depID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
dynamicArgs = append(dynamicArgs, result)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue