Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit d70d7db

Browse files
authored
Use UnixNano for run's executed and finished time (#777)
With dispatch solo the differences between times go below one second, making it harder to differentiate and order runs. This patch changes the time sent over the wire from Unix to UnixNano (from seconds since Jan 1 1970 to nanoseconds since Jan 1 1970) Also fixed a typo in a release pipeline (already applied to concourse)
1 parent 8fcf0bf commit d70d7db

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

ci/pipelines/ova-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
on_failure:
100100
do:
101101
- task: Collect logs
102-
file: dispatch/ci/e2e/collect-logs.yml
102+
file: dispatch/ci/tasks/collect-logs.yml
103103
- put: logs-bucket
104104
params:
105105
file: dispatch-logs/*.tar.gz

pkg/dispatchcli/cmd/get_run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ func formatRunOutput(out io.Writer, list bool, header bool, runs []v1.Run) error
218218
run.Name.String(),
219219
run.FunctionName,
220220
string(run.Status),
221-
time.Unix(run.ExecutedTime, 0).Local().Format(time.UnixDate),
222-
time.Unix(run.FinishedTime, 0).Local().Format(time.UnixDate),
221+
time.Unix(0, run.ExecutedTime).Local().Format(time.RFC3339Nano),
222+
time.Unix(0, run.FinishedTime).Local().Format(time.RFC3339Nano),
223223
})
224224
}
225225
table.Render()

pkg/function-manager/handlers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ func runEntityToModel(f *functions.FnRun) *v1.Run {
191191
tags = append(tags, &v1.Tag{Key: k, Value: v})
192192
}
193193
return &v1.Run{
194-
ExecutedTime: f.CreatedTime.Unix(),
195-
FinishedTime: f.FinishedTime.Unix(),
194+
ExecutedTime: f.CreatedTime.UnixNano(),
195+
FinishedTime: f.FinishedTime.UnixNano(),
196196
Name: strfmt.UUID(f.Name),
197197
Blocking: f.Blocking,
198198
Input: f.Input,

0 commit comments

Comments
 (0)