From: erickson Date: Sun, 19 Aug 2007 01:33:21 +0000 (+0000) Subject: not creating new handle if the current thread already has one. changed resource... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d37a78cc5507ebfdab13eaf7fdf94ec19590e768;p=working%2FOpenSRF.git 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 --- 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()