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

README: use flock in cron job to prevent overlapping jobs

Hendrik Sünkler 8 лет назад
Родитель
Сommit
db04ad24bc
1 измененных файлов: 2 добавлений и 2 удалений
  1. 2
    2
      README.md

+ 2
- 2
README.md Просмотреть файл

@@ -86,6 +86,6 @@ Please note, that you should not use Django's development server in production.
86 86
 Automation
87 87
 ----------
88 88
 
89
-You can configure a cron job to process the queue once every minute:
89
+You can configure a cron job to process the queue once every minute. To prevent overlapping of cron jobs, use the [flock](http://linux.die.net/man/1/flock) command:
90 90
 
91
-    */1 * * * * . /home/hendrik/apps/posttls/env.sh && /home/hendrik/.virtualenvs/posttls/bin/python3 /home/hendrik/apps/posttls/posttls/posttls/manage.py process_queue >/dev/null 2>&1
91
+    */1 * * * * . /home/hendrik/apps/posttls/env.sh && /usr/bin/flock -w 0 /home/hendrik/apps/posttls/cron.lock /home/hendrik/.virtualenvs/posttls/bin/python3 /home/hendrik/apps/posttls/posttls/posttls/manage.py process_queue >/dev/null 2>&1

Загрузка…
Отмена
Сохранить