mirror of
https://github.com/linuxserver/docker-diskover.git
synced 2026-01-19 03:02:06 +08:00
More testing
This commit is contained in:
parent
a2a5de939b
commit
fd9b0ca01d
@ -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
|
||||
|
||||
@ -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]}"
|
||||
|
||||
@ -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]}
|
||||
Loading…
x
Reference in New Issue
Block a user