Fix redis cleanup

Cleanup.sh was unable to read array vars and would error out. Moved commands directly into dispatcher.sh so the cleanup can be ran.
This commit is contained in:
Yocum 2019-07-22 16:40:16 -04:00 committed by Ryan Kuba
parent a8f8ddd70e
commit 18a43a173e
2 changed files with 4 additions and 7 deletions

View File

@ -47,7 +47,6 @@ RUN \
curl -o \
/tmp/diskover-web.tar.gz -L \
"https://github.com/shirosaidev/diskover-web/archive/${DISKOVER_RELEASE}.tar.gz" && \
#"https://github.com/shirosaidev/diskover-web/archive/v1.5.0.2.tar.gz" && \
tar xf \
/tmp/diskover-web.tar.gz -C \
/app/diskover-web/ --strip-components=1 && \

View File

@ -14,30 +14,28 @@ DISKOVER_ARRAY[REDIS_PORT]=${REDIS_PORT:-6379}
DISKOVER_ARRAY[DISKOVER_OPTS]="${DISKOVER_ARRAY[DISKOVER_OPTS]} -i ${DISKOVER_ARRAY[INDEX_NAME]}"
#declare -p DISKOVER_ARRAY > /config/.diskover_array
cd /app/diskover || exit
#/bin/bash -c ". /config/.diskover_array; /app/cleanup.sh"
# Testing moving contents of /app/cleanup.sh here
# Redis Cleanup
# killing existing workers before starting new ones
echo "killing existing workers..."
if [ -f "/tmp/diskover_bot_pids" ]; then
/bin/bash /app/diskover/diskover-bot-launcher.sh -k > /dev/null 2>&1
sleep 3
fi
# empty existing redis queue
echo "emptying current redis queues..."
rq empty -u redis://"${DISKOVER_ARRAY[REDIS_HOST]}":"${DISKOVER_ARRAY[REDIS_PORT]}" diskover_crawl diskover diskover_calcdir failed
sleep 3
# kill dangling workers
echo "killing dangling workers..."
/bin/bash /app/diskover/diskover-bot-launcher.sh -k > /dev/null 2>&1
sleep 3
# Start workers
echo "starting workers with following options: ${DISKOVER_ARRAY[WORKER_OPTS]}"
/bin/bash /app/diskover/diskover-bot-launcher.sh ${DISKOVER_ARRAY[WORKER_OPTS]}
# Start crawler
echo "starting crawler with following options: ${DISKOVER_ARRAY[DISKOVER_OPTS]}"
/usr/bin/python3 ./diskover.py ${DISKOVER_ARRAY[DISKOVER_OPTS]}