From 2ccae9200e0d3ee05c0c30998e3a42fe78f0dc00 Mon Sep 17 00:00:00 2001
From: chbaeh <chbaeh@gmail.com>
Date: Tue, 9 Apr 2019 10:42:24 +0200
Subject: [PATCH] add debug flags for slave

---
 ckanext/odsh/plugin.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py
index 0e511035..3a6107de 100644
--- a/ckanext/odsh/plugin.py
+++ b/ckanext/odsh/plugin.py
@@ -333,6 +333,10 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
 
 
     def before_index(self, dict_pkg):
+        debug = config.get('ckanext.odsh.debug',False)
+        slave = config.get('ckanext.odsh.slave',False)
+        if debug and slave:
+            raise 'indexing on slave not allowed'
         # make special date fields solr conform
         fields = ["issued", "temporal_start", "temporal_end"]
         for field in fields:
-- 
GitLab