Merge pull request #14999 from chlins/fix/p2p-preheat-executions-time-format

fix: format p2p preheat execution start_time and end_time to standard…
This commit is contained in:
ChenYu Zhang 2021-05-30 13:07:16 +08:00 committed by GitHub
commit 04cd5f86dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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: "",