2016-01-28 11:56:32 -05:00
|
|
|
#!/bin/bash -x
|
2016-01-27 10:48:36 -05:00
|
|
|
|
|
|
|
# find all the docHistories with unpacked ops and pack them
|
|
|
|
|
2016-01-28 11:56:32 -05:00
|
|
|
# need to keep track of docs already done
|
|
|
|
|
2016-01-27 10:48:36 -05:00
|
|
|
HOST=${1:-"localhost:3015"}
|
|
|
|
T=${2:-10}
|
|
|
|
|
|
|
|
echo packing all docHistory on $HOST with delay of $T
|
|
|
|
for n in $(seq 5 -1 1) ; do
|
|
|
|
echo starting in $n seconds
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
2016-01-28 11:40:20 -05:00
|
|
|
while docs=$(curl "$HOST/doc/list?limit=1000&doc_id=$last_doc"); do
|
2016-01-27 10:14:23 -05:00
|
|
|
if [ -z "$docs" ] ; then break ; fi
|
|
|
|
for d in $docs ; do
|
|
|
|
echo "packing $d"
|
2016-01-27 10:48:36 -05:00
|
|
|
curl -X POST "$HOST/doc/$d/pack"
|
|
|
|
sleep $T
|
2016-01-28 11:40:20 -05:00
|
|
|
last_doc=$d
|
2016-01-27 10:14:23 -05:00
|
|
|
done
|
|
|
|
done
|