summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-02-26 08:43:05 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-02-26 08:45:45 (GMT)
commit445ca4651f967e11f785c39152f1e1d0b8ad5614 (patch)
treefe5b74f90b9d4674917f6ba4f5b3899f41e45a25
parent68d734fc785e7c2d329e665fbbfd43c12e38b02f (diff)
downloadpublik-client-scripts-445ca4651f967e11f785c39152f1e1d0b8ad5614.zip
publik-client-scripts-445ca4651f967e11f785c39152f1e1d0b8ad5614.tar.gz
publik-client-scripts-445ca4651f967e11f785c39152f1e1d0b8ad5614.tar.bz2
strasbourg: add hacked/cheap way to follow disable_cron policy
-rw-r--r--clients/strasbourg/index-formdefs-in-elasticsearch.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/clients/strasbourg/index-formdefs-in-elasticsearch.py b/clients/strasbourg/index-formdefs-in-elasticsearch.py
index 540ec6c..1ffa641 100644
--- a/clients/strasbourg/index-formdefs-in-elasticsearch.py
+++ b/clients/strasbourg/index-formdefs-in-elasticsearch.py
@@ -3,6 +3,12 @@
# run as:
# sudo -u wcs wcsctl runscript index-formdefs-in-elasticsearch.py --vhost=...
+import os
+import sys
+
+if os.path.exists('/etc/wcs/settings.d/disable_cron.py') and "DISABLE_CRON_JOBS = True" in open('/etc/wcs/settings.d/disable_cron.py').read():
+ sys.exit(0)
+
from elasticsearch import Elasticsearch
from quixote import get_publisher