mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 02:05:41 +01:00
Keep CheckInAt time empty when it is empty (#17877)
Fixes #17860 Signed-off-by: stonezdj <daojunz@vmware.com> Signed-off-by: stonezdj <daojunz@vmware.com>
This commit is contained in:
parent
bcbfad632a
commit
80999f28ee
@ -86,16 +86,23 @@ func toWorkerResponse(wks []*jm.Worker) []*models.Worker {
|
||||
PoolID: w.PoolID,
|
||||
})
|
||||
} else {
|
||||
startAtTime := covertTime(w.StartedAt)
|
||||
checkInAtTime := covertTime(w.CheckInAt)
|
||||
var startAtTime, checkInAtTime *strfmt.DateTime
|
||||
if w.StartedAt != 0 {
|
||||
t := covertTime(w.StartedAt)
|
||||
startAtTime = &t
|
||||
}
|
||||
if w.CheckInAt != 0 {
|
||||
t := covertTime(w.CheckInAt)
|
||||
checkInAtTime = &t
|
||||
}
|
||||
workers = append(workers, &models.Worker{
|
||||
ID: w.ID,
|
||||
JobName: w.JobName,
|
||||
JobID: w.JobID,
|
||||
PoolID: w.PoolID,
|
||||
Args: w.Args,
|
||||
StartAt: &startAtTime,
|
||||
CheckinAt: &checkInAtTime,
|
||||
StartAt: startAtTime,
|
||||
CheckinAt: checkInAtTime,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user