store: Set JobStarted time when PopJob is called

If you don't set the time it ends up being the default Go time which is
1/1/1 and when you convert that using UnixNano() you get a nice big
negative number (-6795364578871345152) which then eventually shows up in
the queue, finished, and failed output as 'Fri Aug 30 17:47:39 1754'
and since the Time Travel feature is not yet complete this is
impossible.

The fix is to set it when the job is started.
This commit is contained in:
Brian C. Lane 2020-04-09 14:07:45 -07:00 committed by Tom Gundersen
parent 54c44cf135
commit 4f502a286c

View file

@ -607,6 +607,7 @@ func (s *Store) PopJob() Job {
}
// Change queue status to running for the image build as well as for the targets
compose.ImageBuilds[job.ImageBuildID].QueueStatus = common.IBRunning
compose.ImageBuilds[job.ImageBuildID].JobStarted = time.Now()
for m := range compose.ImageBuilds[job.ImageBuildID].Targets {
compose.ImageBuilds[job.ImageBuildID].Targets[m].Status = common.IBRunning
}