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