Просмотр исходного кода

Merge branch 'master' of github.com:celery/celery

Ask Solem 9 лет назад
Родитель
Сommit
7b0cca0b4f
2 измененных файлов с 8 добавлено и 3 удалено
  1. 2 2
      docs/userguide/tasks.rst
  2. 6 1
      extra/generic-init.d/celeryd

+ 2 - 2
docs/userguide/tasks.rst

@@ -497,7 +497,7 @@ but this will not happen if:
 
 - An ``exc`` argument was not given.
 
-    In this case the :exc:`~@MaxRetriesExceeded`
+    In this case the :exc:`~@MaxRetriesExceededError`
     exception will be raised.
 
 - There is no current exception
@@ -615,7 +615,7 @@ General
 .. attribute:: Task.max_retries
 
     The maximum number of attempted retries before giving up.
-    If the number of retries exceeds this value a :exc:`~@MaxRetriesExceeded`
+    If the number of retries exceeds this value a :exc:`~@MaxRetriesExceededError`
     exception will be raised.  *NOTE:* You have to call :meth:`~@Task.retry`
     manually, as it will not automatically retry on exception..
 

+ 6 - 1
extra/generic-init.d/celeryd

@@ -37,9 +37,14 @@ if [ $(id -u) -ne 0 ]; then
     exit 1
 fi
 
+origin_is_runlevel_dir () {
+    set +e
+    dirname $0 | grep -q "/etc/rc.\.d"
+    echo $?
+}
 
 # Can be a runlevel symlink (e.g. S02celeryd)
-if [[ `dirname $0` == /etc/rc*.d ]]; then
+if [ $(origin_is_runlevel_dir) -eq 0 ]; then
     SCRIPT_FILE=$(readlink "$0")
 else
     SCRIPT_FILE="$0"