From 5dcbccd236f8a9a9f9a3e7c28f2725cf27ec5eda Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Tue, 16 Jun 2020 08:31:32 +0200 Subject: [PATCH] simplify updateArray --- modules/jsonDB.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/jsonDB.sh b/modules/jsonDB.sh index 3edfc59..d166e93 100644 --- a/modules/jsonDB.sh +++ b/modules/jsonDB.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.98-dev-22-gc943280 +#### $$VERSION$$ v0.98-dev-28-g70e7ee4 # # source from commands.sh to use jsonDB functions # @@ -157,7 +157,7 @@ if [ "$(LC_ALL=C type -t "flock")" = "file" ]; then [ -z "${2}" ] && return 1 local DB="${2}.jssh" # name check in async [ ! -f "${DB}" ] && return 2 - { flock -s -w 1 200; jssh_updateArray_async "$@"; } 200>"${DB}${JSSH_LOCKNAME}" + [ "${DB}" -nt "${DB}.last${3}" ] && touch "${DB}.last${3}" && jssh_readDB "${1}" "${2}" } else