ci: split get_job_seconds() computation out of get_current_minsec() formatting

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39395>
This commit is contained in:
Eric Engestrom 2026-01-20 08:41:26 +01:00 committed by Marge Bot
parent 6b0e29bc77
commit 2d1d94d3c2

View file

@ -41,9 +41,13 @@ export JOB_START_S=$(
{ date -u +"%s" -D "%Y-%m-%dT%H:%M:%SZ" "$CI_JOB_STARTED_AT" 2>/dev/null || true; }
)
function get_current_minsec {
function get_job_seconds {
DATE_S=$(date -u +"%s")
CURR_TIME=$((DATE_S-JOB_START_S))
echo $((DATE_S-JOB_START_S))
}
function get_current_minsec {
CURR_TIME=$(get_job_seconds)
printf "%02d:%02d" $((CURR_TIME/60)) $((CURR_TIME%60))
}