Skip to content

Commit d9b637e

Browse files
committed
Improved sleep stuff.
1 parent 4fadc28 commit d9b637e

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

data-loading/setup-and-load-solr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ for f in $1; do
2424
# curl -X POST -T $f will stream it. See https://github.com/TranslatorSRI/NameResolution/issues/194
2525
curl -H 'Content-Type: application/json' -X POST -T $f \
2626
"$SOLR_SERVER/solr/name_lookup/update/json/docs?processor=uuid&uuid.fieldName=id&commit=true"
27-
sleep 30
27+
sleep 60
2828
done
2929
echo "Check solr"
3030
curl -s --negotiate -u: "$SOLR_SERVER/solr/name_lookup/query?q=*:*&rows=0"

solr-restore/restore.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ set -uo pipefail
1818

1919
# Configuration options
2020
SOLR_SERVER="http://localhost:8983"
21+
SLEEP_INTERVAL=60
2122

2223
# Please don't change these values unless you change NameRes appropriately!
2324
COLLECTION_NAME="name_lookup"
@@ -43,12 +44,16 @@ CORE_NAME="${COLLECTION_NAME}_shard1_replica_n1"
4344
echo "Starting Solr restore on core ${CORE_NAME}, with status at ${SOLR_SERVER}/solr/${CORE_NAME}/replication?command=restorestatus"
4445
RESTORE_URL="${SOLR_SERVER}/solr/${CORE_NAME}/replication?command=restore&location=/var/solr/data/var/solr/data/&name=${BACKUP_NAME}"
4546
wget -O - "$RESTORE_URL"
46-
sleep 10
47+
sleep "$SLEEP_INTERVAL"
4748
RESTORE_STATUS_URL="${SOLR_SERVER}/solr/${CORE_NAME}/replication?command=restorestatus"
48-
RESTORE_STATUS=$(wget -q -O - "$RESTORE_STATUS_URL" 2>&1 | grep "success") >&2
49+
RESTORE_STATUS=$(wget -q -O - "$RESTORE_STATUS_URL" 2>&1 | grep "success")
50+
RESTORE_STATUS=""
4951
until [ -n "$RESTORE_STATUS" ] ; do
50-
echo "Solr restore in progress. Note: if this takes too long please check Solr health."
51-
RESTORE_STATUS=$(wget -O - "$RESTORE_STATUS_URL" 2>&1 | grep "success") >&2
52-
sleep 10
52+
echo "Solr restore in progress. If this takes longer than 30 minutes, please visit ${SOLR_SERVER} with your browser to check Solr."
53+
RESTORE_STATUS=$(wget -q -O - "$RESTORE_STATUS_URL" 2>&1 | grep "success")
54+
sleep "$SLEEP_INTERVAL"
5355
done
54-
echo "Solr restore complete"
56+
echo "Solr restore complete!"
57+
58+
echo "Solr contents:"
59+
curl -s --negotiate -u: "$SOLR_SERVER/solr/name_lookup/query?q=*:*&rows=0"

0 commit comments

Comments
 (0)