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

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jun 7 15:14:02 EDT 2010


Author: erickson
Date: 2010-06-07 15:13:57 -0400 (Mon, 07 Jun 2010)
New Revision: 888

Modified:
   constrictor/trunk/contrib/evergreen/eg_batch.py
   constrictor/trunk/contrib/evergreen/eg_data.py
Log:
filter out copies and org-units that are more likely to cause early exit from circ transactions.  log api calls in a srfsh-compliant fashion (iow, no array brackets)

Modified: constrictor/trunk/contrib/evergreen/eg_batch.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_batch.py	2010-05-18 21:30:37 UTC (rev 887)
+++ constrictor/trunk/contrib/evergreen/eg_batch.py	2010-06-07 19:13:57 UTC (rev 888)
@@ -16,7 +16,7 @@
         self.method = method
 
     def run(self, **kw):
-        log.log_info("Batch call: %s %s" % (self.method, osrf.json.to_json(kw['params'])))
+        log.log_info("Batch call: %s %s" % (self.method, osrf.json.to_json(kw['params'])[1:-1]))
         return self.run_method(*kw['params'])
 
 

Modified: constrictor/trunk/contrib/evergreen/eg_data.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_data.py	2010-05-18 21:30:37 UTC (rev 887)
+++ constrictor/trunk/contrib/evergreen/eg_data.py	2010-06-07 19:13:57 UTC (rev 888)
@@ -28,7 +28,7 @@
         self.method = method
 
     def run(self, **kw):
-        log.log_info("Data Method: %s %s" % (self.method, osrf.json.to_json(kw['params'])))
+        log.log_info("Data Method: %s %s" % (self.method, osrf.json.to_json(kw['params'])[1:-1]))
         return self.run_method(*kw['params'])
 
 
@@ -58,7 +58,19 @@
         if not self.data.get(PROP_COPY_ID) or not self.data.get(PROP_COPY_BARCODE):
 
             copies = DataMethodTask(pcrud, method % 'acp').start(
-                params = [auth, {'deleted' : 'f', 'id' : {'>' : 0}}, {'limit' : thread_count}])
+                params = [
+                    auth,
+                    {
+                        'deleted':'f',
+                        'id' : {'>' : 0},
+                        'holdable' : 't',
+                        'circulate' : 't',
+                        '+acpl':{'holdable':'t'},
+                        '+ccs':{'holdable':'t'}
+                    },
+                    {'limit' : thread_count, 'join': {'acpl' : {}, 'ccs' : {}}}
+                ]
+            )
 
             if not self.data.get(PROP_COPY_ID):
                 self.insert_prop_data(PROP_COPY_ID, [obj.id() for obj in copies])
@@ -76,13 +88,17 @@
         if not self.data.get(PROP_ORG_ID) or not self.data.get(PROP_ORG_SHORTNAME):
 
             org_units = DataMethodTask(pcrud, method % 'aou').start(
-                params = [auth, {'id' : {'>' : 0}}, {'limit' : thread_count}])
+                params = [
+                    auth,
+                    {'id' : {'>' : 0}, '+aout':{'can_have_vols' : 't', 'can_have_users' : 't'}},
+                    {'limit' : thread_count, 'join' : 'aout'}
+                ]
+            )
 
             if not self.data.get(PROP_ORG_ID):
                 self.insert_prop_data(PROP_ORG_ID, [obj.id() for obj in org_units])
 
             if not self.data.get(PROP_ORG_SHORTNAME):
-
                 self.insert_prop_data(PROP_ORG_SHORTNAME, [obj.shortname() for obj in org_units])
 
 



More information about the open-ils-commits mailing list