From e7ccb82dac96dd81cd79438e639987338e9feebd Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 10 Nov 2023 16:17:09 +0100 Subject: [PATCH] Don't index if data is empty (#350) --- cron.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cron.sh b/cron.sh index 4060fd1..c28890a 100644 --- a/cron.sh +++ b/cron.sh @@ -8,11 +8,14 @@ set -uo pipefail # See http://redsymbol.net/articles/unofficial-bash-strict-mode IFS=$'\n\t' RECIPIENT=lobid-admin sbt -mem 4000 "runMain apps.ConvertUpdates $(tail -n1 GND-lastSuccessfulUpdate.txt)" -sbt -Dindex.prod.name=gnd-test "runMain apps.Index updates" -bash ./checkCompactedProperties.sh gnd-test -# if check ok, index to productive instance: -if [ $? -eq 0 ]; then - sbt -Dindex.prod.name=gnd "runMain apps.Index updates" - bash ./checkCompactedProperties.sh gnd +if [ -s GND-updates.jsonl ]; then + sbt -Dindex.prod.name=gnd-test "runMain apps.Index updates" + bash ./checkCompactedProperties.sh gnd-test + + # if check ok, index to productive instance: + if [ $? -eq 0 ]; then + sbt -Dindex.prod.name=gnd "runMain apps.Index updates" + bash ./checkCompactedProperties.sh gnd + fi fi