More testing

This commit is contained in:
Yocum 2019-07-22 18:21:47 -04:00 committed by Ryan Kuba
parent a2a5de939b
commit fd9b0ca01d
3 changed files with 50 additions and 36 deletions

View File

@ -1,5 +1,14 @@
#!/bin/bash
. /config/.env
# define array for input values
declare -A DISKOVER_ARRAY
DISKOVER_ARRAY[REDIS_HOST]=${REDIS_HOST:-redis}
DISKOVER_ARRAY[REDIS_PORT]=${REDIS_PORT:-6379}
DISKOVER_ARRAY[DISKOVER_OPTS]="${DISKOVER_ARRAY[DISKOVER_OPTS]} -i ${DISKOVER_ARRAY[INDEX_NAME]}"
# killing existing workers before starting new ones
echo "killing existing workers..."
if [ -f "/tmp/diskover_bot_pids" ]; then

View File

@ -17,20 +17,21 @@ DISKOVER_ARRAY[DISKOVER_OPTS]="${DISKOVER_ARRAY[DISKOVER_OPTS]} -i ${DISKOVER_AR
cd /app/diskover || exit
# Redis Cleanup
/bin/bash /app/cleanup.sh
# 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
#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
#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
#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]}"

View File

@ -6,36 +6,40 @@
. /config/.env
# define array for input values
declare -A DISKOVER_ARRAY
DISKOVER_ARRAY[REDIS_HOST]=${REDIS_HOST:-redis}
DISKOVER_ARRAY[REDIS_PORT]=${REDIS_PORT:-6379}
#declare -A DISKOVER_ARRAY
#DISKOVER_ARRAY[REDIS_HOST]=${REDIS_HOST:-redis}
#DISKOVER_ARRAY[REDIS_PORT]=${REDIS_PORT:-6379}
DISKOVER_ARRAY[DISKOVER_OPTS]="${DISKOVER_ARRAY[DISKOVER_OPTS]} -i ${DISKOVER_ARRAY[INDEX_NAME]}"
_term() {
#/bin/bash /app/cleanup.sh
# 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
}
trap _term SIGTERM
#DISKOVER_ARRAY[DISKOVER_OPTS]="${DISKOVER_ARRAY[DISKOVER_OPTS]} -i ${DISKOVER_ARRAY[INDEX_NAME]}"
declare -A REDIS_CONF
REDIS_CONF[REDIS_HOST]=${REDIS_HOST:-redis}
REDIS_CONF[REDIS_PORT]=${REDIS_PORT:-6379}
_term() {
/bin/bash /app/cleanup.sh
# 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
}
trap _term SIGTERM
#declare -A REDIS_CONF
#REDIS_CONF[REDIS_HOST]=${REDIS_HOST:-redis}
#REDIS_CONF[REDIS_PORT]=${REDIS_PORT:-6379}
exec \
s6-setuidgid abc /usr/bin/rq-dashboard -H ${REDIS_CONF[REDIS_HOST]} -P ${REDIS_CONF[REDIS_PORT]}