Skip to content

Commit

Permalink
Merge pull request #4611 from GSA/revert-date-fix
Browse files Browse the repository at this point in the history
Revert "fix date error after busybox"
  • Loading branch information
btylerburton authored Feb 7, 2024
2 parents e9fbdeb + 1d0e278 commit 24d82e0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bin/check-and-renew
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ function check_running_job {
# Get the time of the last line in the log (int)
current_time=$(date --utc +%s)
log_last_time () {
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
date --utc --date="$(cf logs --recent "$app_to_check" | tail -n 1 | awk '{split($0,time," "); print time[1]}')" +%s
}

# First we check if any instance CPU is busy
Expand Down

0 comments on commit 24d82e0

Please sign in to comment.