Improve celery wrapper script
authorCharles Connell <charles@connells.org>
Fri, 23 May 2014 19:06:23 +0000 (15:06 -0400)
committerCharles Connell <charles@connells.org>
Fri, 23 May 2014 19:06:23 +0000 (15:06 -0400)
celerywrapper.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 7ae2289..4fe68a1
@@ -1,3 +1,11 @@
 #!/bin/bash
 python manage.py celery worker --pidfile=/tmp/celeryd.pid -l info &
-python manage.py celery beat --pidfile=/tmp/beat.pid -l info &
+sleep 5
+workerpid=`cat /tmp/celeryd.pid`
+echo "Started celery worker with pid $workerpid"
+python manage.py celery beat --pidfile=/tmp/celerybeat.pid -l info &
+sleep 5
+beatpid=`cat /tmp/celerybeat.pid`
+echo "Started celery beat with pid $beatpid"
+wait $workerpid
+wait $beatpid