dont run cron tasks in encoding queue, can only have one instance, cron jobs are executed several times otherwise

This commit is contained in:
j 2013-02-21 06:55:49 +00:00
parent c2c007401e
commit 0fe00fd106
3 changed files with 28 additions and 4 deletions

View file

@ -0,0 +1,24 @@
# pandora cron daemon
#
description "pandora cron daemon"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
env VENV=/srv/pandora
env USER=pandora
env HOME=/home/pandora
script
test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $USER:$USER /var/log/pandora)
test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora)
cd $VENV/pandora
exec /usr/bin/sudo -u $USER $VENV/bin/python $VENV/pandora/manage.py celerybeat \
-s /var/run/pandora/celerybeat-schedule \
--pidfile /var/run/pandora/pandora-cron.pid \
-f /var/log/pandora/pandora-cron.log \
-l INFO
end script

View file

@ -17,7 +17,6 @@ test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $USER:$USER /var
test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora) test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora)
cd $VENV/pandora cd $VENV/pandora
exec /usr/bin/sudo -u $USER $VENV/bin/python $VENV/pandora/manage.py celeryd \ exec /usr/bin/sudo -u $USER $VENV/bin/python $VENV/pandora/manage.py celeryd \
-B -s /var/run/pandora/celerybeat-schedule \
-Q encoding \ -Q encoding \
-n pandora-encoding \ -n pandora-encoding \
--pidfile /var/run/pandora/pandora-encoding.pid \ --pidfile /var/run/pandora/pandora-encoding.pid \

View file

@ -1,3 +1,4 @@
service pandora reload #!/bin/sh
service pandora-tasks reload for service in pandora pandora-tasks pandora-encoding pandora-cron; do
service pandora-encoding reload service $service reload
done