From 0e7b116784ff3275aba3ee5c2d6fca1d57629375 Mon Sep 17 00:00:00 2001 From: erickson Date: Sat, 29 Jan 2011 16:06:51 +0000 Subject: [PATCH] build datamanager at script init instead of during each call to run() to avoid unnecessary server calls git-svn-id: svn://svn.open-ils.org/ILS-Contrib/constrictor/trunk@1214 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- contrib/evergreen/eg_checkout_roundtrip.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/contrib/evergreen/eg_checkout_roundtrip.py b/contrib/evergreen/eg_checkout_roundtrip.py index e7a696e66..bc66bbe60 100644 --- a/contrib/evergreen/eg_checkout_roundtrip.py +++ b/contrib/evergreen/eg_checkout_roundtrip.py @@ -6,16 +6,21 @@ from eg_data import * from eg_workflow import * eg_utils.init() - +dm = None class CheckoutRoundtripScript(Script): + def __init__(self): + global dm + Script.__init__(self) + dm = DataManager() + + def on_thread_init(self, scriptThread): eg_utils.init_thread() def run(self): - dm = DataManager() patronID = dm.get_thread_data(PROP_PATRON_ID) copyBarcode = dm.get_thread_data(PROP_COPY_BARCODE, True) -- 2.11.0