-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
ImprovementMinor improvement to codeMinor improvement to code
Description
We have this code
ext-theme/src/js/build/detail.js
Lines 320 to 338 in 7115c24
| this.length.subscribe((length) => { | |
| let duration; | |
| if (length) { | |
| duration = dayjs.duration(length, "seconds"); | |
| } else { | |
| // Infer length from build start time | |
| const dateNow = dayjs(); | |
| const dateStart = dayjs(this.date()); | |
| duration = dayjs.duration(dateNow.diff(dateStart)); | |
| } | |
| let formatParts = ["s[s]"]; | |
| if (duration.minutes()) { | |
| formatParts.unshift("m[m]"); | |
| } | |
| if (duration.hours()) { | |
| formatParts.unshift("H[h]"); | |
| } | |
| this.length_display(duration.format(formatParts.join(" "))); | |
| }); |
that infers the build duration based on Build.date. However, that date may not be accurate if the build was not immediate executed, or if it was retried a few times.
To make this infer more accurate, we should use the BuildCommand.start_date from the first build command (usually, git clone). That will give use a more realistic value here.
ericholscher
Metadata
Metadata
Assignees
Labels
ImprovementMinor improvement to codeMinor improvement to code