[open-ils-commits] r997 - constrictor/trunk/contrib/evergreen (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 17 19:23:21 EDT 2010


Author: erickson
Date: 2010-09-17 19:23:20 -0400 (Fri, 17 Sep 2010)
New Revision: 997

Modified:
   constrictor/trunk/contrib/evergreen/eg_bib_search.py
Log:
in bib search, create the datamanager on thread init to prevent excessive seed data collection on re-runs

Modified: constrictor/trunk/contrib/evergreen/eg_bib_search.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_bib_search.py	2010-09-17 18:11:08 UTC (rev 996)
+++ constrictor/trunk/contrib/evergreen/eg_bib_search.py	2010-09-17 23:23:20 UTC (rev 997)
@@ -4,13 +4,21 @@
 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,



More information about the open-ils-commits mailing list