Skip to content

Commit

Permalink
Merge pull request #4605 from GSA/busybox-date
Browse files Browse the repository at this point in the history
fix date error after busybox
btylerburton authored Feb 1, 2024
2 parents 0d811b8 + c89442b commit 40bcb31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/check-and-renew
Original file line number Diff line number Diff line change
@@ -77,7 +77,10 @@ function check_running_job {
# Get the time of the last line in the log (int)
current_time=$(date --utc +%s)
log_last_time () {
date --utc --date="$(cf logs --recent "$app_to_check" | tail -n 1 | awk '{split($0,time," "); print time[1]}')" +%s
last_time=$(cf logs --recent "$app_to_check" | tail -n 1 | awk '{split($0,time," "); print time[1]}')
# convert string "2024-02-01T17:02:55.83+0000" to "2024-02-01 17:02:55" for busybox date to read
last_time=$(echo "$last_time" | sed 's/T/ /' | sed 's/\..*//')
date --utc --date="$last_time" +%s
}

# First we check if any instance CPU is busy

0 comments on commit 40bcb31

Please sign in to comment.