From 1d0e27893624732ff078db2f79ddd2ef0832fa75 Mon Sep 17 00:00:00 2001 From: Fuhu Xia Date: Wed, 7 Feb 2024 15:50:29 -0500 Subject: [PATCH] Revert "fix date error after busybox" This reverts commit c89442b8c2ff783cdf680e95206a1063c4bc7770. --- bin/check-and-renew | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bin/check-and-renew b/bin/check-and-renew index e6b9721a7..6783d12a7 100755 --- a/bin/check-and-renew +++ b/bin/check-and-renew @@ -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