check exit code directly in update_date function

This commit is contained in:
ksyasuda 2022-02-20 19:57:40 -08:00
parent 8fb570b003
commit f95ae51af8

View File

@ -245,9 +245,7 @@ update_date() {
insert_history() { insert_history() {
datetime=$(date +'%Y-%m-%d %H:%M:%S') datetime=$(date +'%Y-%m-%d %H:%M:%S')
lg "Checking if ($*) exists in db" lg "Checking if ($*) exists in db"
check_db "$@" if ! check_db "$@"; then
res="$?"
if [[ $res -gt 0 ]]; then
lg "Match found... Updating row in history db..." lg "Match found... Updating row in history db..."
update_date "$@" update_date "$@"
res=$? res=$?