mirror of
https://github.com/linuxserver/docker-diskover.git
synced 2026-02-20 04:57:50 +08:00
Fix redis cleanup
Cleanup.sh was unable to read array vars and would error out. Moved commands directly into the sigterm trap so the cleanup actually runs.
This commit is contained in:
parent
18a43a173e
commit
5a4222c4b0
@ -3,7 +3,22 @@
|
||||
# need to safely handle exiting the existing worker bots and
|
||||
# redis queue when container restarts or stops
|
||||
_term() {
|
||||
/bin/bash /app/cleanup.sh
|
||||
#/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
|
||||
@ -13,4 +28,4 @@ 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]}
|
||||
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