Author: justi9
Date: 2008-12-11 15:03:58 -0500 (Thu, 11 Dec 2008)
New Revision: 2982
Modified:
mgmt/trunk/mint/python/mint/__init__.py
Log:
Don't loop really fast when we fail to connect to a broker
Modified: mgmt/trunk/mint/python/mint/__init__.py
===================================================================
--- mgmt/trunk/mint/python/mint/__init__.py 2008-12-11 19:33:36 UTC (rev 2981)
+++ mgmt/trunk/mint/python/mint/__init__.py 2008-12-11 20:03:58 UTC (rev 2982)
@@ -4,6 +4,7 @@
import struct
import sys
import types
+import socket
from threading import Lock, RLock
from sqlobject import *
from traceback import print_exc
@@ -555,11 +556,15 @@
regUrls = set()
for reg in BrokerRegistration.select():
+ if reg.url not in self.model.mintBrokersByUrl:
+ try:
+ self.model.addBroker(reg.url)
+ except socket.error, e:
+ log.info("Can't connect to broker at %s: %s", reg.url, e)
+ pass
+
regUrls.add(reg.url)
- if reg.url not in self.model.mintBrokersByUrl:
- self.model.addBroker(reg.url)
-
for mbroker in self.model.mintBrokersByQmfBroker.values():
if mbroker.url not in regUrls:
self.model.delBroker(mbroker)
Show replies by date