[rhmessaging-commits] rhmessaging commits: r3776 - in mgmt/trunk: mint/python/mint and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Jan 11 09:28:55 EST 2010


Author: justi9
Date: 2010-01-11 09:28:55 -0500 (Mon, 11 Jan 2010)
New Revision: 3776

Removed:
   mgmt/trunk/mint/python/mint/poll.py
Modified:
   mgmt/trunk/cumin/python/cumin/model.py
   mgmt/trunk/mint/python/mint/main.py
Log:
Remove the now unused polling facility

Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py	2010-01-08 22:35:57 UTC (rev 3775)
+++ mgmt/trunk/cumin/python/cumin/model.py	2010-01-11 14:28:55 UTC (rev 3776)
@@ -26,7 +26,6 @@
 
         self.mint = Mint(config)
         self.mint.updateEnabled = False
-        self.mint.pollEnabled = False
         self.mint.expireEnabled = False
         self.mint.vacuumEnabled = False
 

Modified: mgmt/trunk/mint/python/mint/main.py
===================================================================
--- mgmt/trunk/mint/python/mint/main.py	2010-01-08 22:35:57 UTC (rev 3775)
+++ mgmt/trunk/mint/python/mint/main.py	2010-01-11 14:28:55 UTC (rev 3776)
@@ -9,7 +9,6 @@
 from database import MintDatabase
 from expire import ExpireThread
 from model import MintModel
-from poll import PollThread
 from update import UpdateThread
 from vacuum import VacuumThread
 
@@ -26,9 +25,6 @@
     self.updateEnabled = True
     self.updateThread = UpdateThread(self)
 
-    self.pollEnabled = False
-    self.pollThread = PollThread(self)
-
     self.expireEnabled = True
     self.expireFrequency = self.config.expire_frequency
     self.expireThreshold = self.config.expire_threshold
@@ -49,11 +45,9 @@
       return cond and "enabled" or "disabled"
 
     log.info("Updates are %s", state(self.updateEnabled))
-    log.info("Polling is %s", state(self.pollEnabled))
     log.info("Expiration is %s", state(self.expireEnabled))
 
     self.updateThread.init()
-    self.pollThread.init()
     self.expireThread.init()
     self.vacuumThread.init()
 
@@ -63,9 +57,6 @@
     if self.updateEnabled:
       self.updateThread.start()
 
-    if self.pollEnabled:
-      self.pollThread.start()
-
     if self.expireEnabled:
       self.expireThread.start()
 
@@ -78,9 +69,6 @@
     if self.updateEnabled:
       self.updateThread.stop()
 
-    if self.pollEnabled:
-      self.pollThread.stop()
-
     if self.expireEnabled:
       self.expireThread.stop()
 

Deleted: mgmt/trunk/mint/python/mint/poll.py
===================================================================
--- mgmt/trunk/mint/python/mint/poll.py	2010-01-08 22:35:57 UTC (rev 3775)
+++ mgmt/trunk/mint/python/mint/poll.py	2010-01-11 14:28:55 UTC (rev 3776)
@@ -1,31 +0,0 @@
-import logging
-from time import sleep
-from psycopg2 import OperationalError
-
-from util import MintDaemonThread
-
-log = logging.getLogger("mint.poll")
-
-class PollThread(MintDaemonThread):
-  interval = 5
-
-  def run(self):
-    log.info("Polling for changes every %i seconds", self.interval)
-
-    while True:
-      try:
-        if self.stopRequested:
-          break
-
-        self.do_run()
-      except OperationalError, e:
-        log.exception(e)
-        if str(e).find("server closed the connection unexpectedly") >= 0:
-          sys.exit() # XXX This seems like the wrong thing to do
-      except Exception, e:
-        log.exception(e)
-
-      sleep(self.interval)
-
-  def do_run(self):
-    pass



More information about the rhmessaging-commits mailing list