added redis dependency and start_pre loop to check that redis is ready
This commit is contained in:
@@ -3,11 +3,24 @@
|
||||
. /etc/conf.d/mastodon
|
||||
|
||||
name="Mastodon background workers Service"
|
||||
|
||||
pidfile="${INSTALLROOT}/worker.pid"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
need redis-server
|
||||
}
|
||||
|
||||
pre_start() {
|
||||
if [ "${RC_CMD}" != "restart" ] ; then
|
||||
for run in {1..10}; do
|
||||
status="$(redis-cli ping)"
|
||||
if [[ "$status" == "PONG" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
@@ -19,7 +32,7 @@ start() {
|
||||
--pidfile="${pidfile}" \
|
||||
-3 logger \
|
||||
-4 logger \
|
||||
-b -m \
|
||||
-C -b -m \
|
||||
--exec /usr/bin/env -- RAILS_ENV=production DB_POOL=${DB_POOL} \
|
||||
bundle exec sidekiq -c ${SIDEKIQ_WORKERS} -q default,8 -q scheduler,1 -q mailers,1 -q push,6 -q ingress,4 -q pull,1 -q fasp
|
||||
eend $?
|
||||
|
||||
Reference in New Issue
Block a user