From d37a78cc5507ebfdab13eaf7fdf94ec19590e768 Mon Sep 17 00:00:00 2001 From: erickson Date: Sun, 19 Aug 2007 01:33:21 +0000 Subject: [PATCH] not creating new handle if the current thread already has one. changed resource layout git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1082 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/osrf/net.py | 2 +- src/python/osrf/system.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/python/osrf/net.py b/src/python/osrf/net.py index 7db4fe7..85afe47 100644 --- a/src/python/osrf/net.py +++ b/src/python/osrf/net.py @@ -70,7 +70,7 @@ class osrfNetwork(JabberClient): self.isconnected = False # Create a unique jabber resource - resource = 'python_' + resource = 'python' if args.has_key('resource'): resource = args['resource'] resource += '_' + gethostname()+':'+ str(os.getpid()) + '_'+ threading.currentThread().getName().lower() diff --git a/src/python/osrf/system.py b/src/python/osrf/system.py index 94ad907..362fdd0 100644 --- a/src/python/osrf/system.py +++ b/src/python/osrf/system.py @@ -24,6 +24,10 @@ import sys def osrfConnect(configFile, configContext): """ Connects to the opensrf network """ + if osrfGetNetworkHandle(): + ''' This thread already has a handle ''' + return + # parse the config file configParser = osrfConfig(configFile, configContext) configParser.parseConfig() -- 2.43.2