From f8ba6bc31b6e9dd7e073b5b1d424ae79b5b5cd78 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 17 Sep 2010 23:23:20 +0000 Subject: [PATCH] in bib search, create the datamanager on thread init to prevent excessive seed data collection on re-runs git-svn-id: svn://svn.open-ils.org/ILS-Contrib/constrictor/trunk@997 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- contrib/evergreen/eg_bib_search.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/evergreen/eg_bib_search.py b/contrib/evergreen/eg_bib_search.py index 02cb067a1..4ff8cf8a7 100644 --- a/contrib/evergreen/eg_bib_search.py +++ b/contrib/evergreen/eg_bib_search.py @@ -4,13 +4,21 @@ from constrictor.log import * import eg_utils, eg_data, eg_tasks import random +dm = None +org_id = None + class BibSearchScript(Script): - def run(self): + def on_thread_init(self, thread): + global dm + global org_id dm = eg_data.DataManager() org_id = dm.get_thread_data(eg_data.PROP_ORG_ID) or 1 + def run(self): + + search_args = { 'org_unit' : org_id, 'depth' : 0, -- 2.11.0