fix: format p2p preheat execution start_time and end_time to standard time format

Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
chlins 2021-05-27 18:40:02 +08:00
parent 37d161c141
commit 5833f5498c
2 changed files with 4 additions and 4 deletions

View File

@ -540,10 +540,10 @@ func convertExecutionToPayload(model *task.Execution) (*models.Execution, error)
}
execution := &models.Execution{
EndTime: model.EndTime.String(),
EndTime: model.EndTime.Format(time.RFC3339),
ExtraAttrs: model.ExtraAttrs,
ID: model.ID,
StartTime: model.StartTime.String(),
StartTime: model.StartTime.Format(time.RFC3339),
Status: model.Status,
StatusMessage: model.StatusMessage,
Trigger: model.Trigger,

View File

@ -320,11 +320,11 @@ func Test_convertExecutionToPayload(t *testing.T) {
EndTime: time.Time{},
},
expect: &models.Execution{
EndTime: "0001-01-01 00:00:00 +0000 UTC",
EndTime: "0001-01-01T00:00:00Z",
ExtraAttrs: nil,
ID: 1,
Metrics: nil,
StartTime: "0001-01-01 00:00:00 +0000 UTC",
StartTime: "0001-01-01T00:00:00Z",
Status: "",
StatusMessage: "",
Trigger: "",