diff --git a/Script/CheckThread.py b/Script/CheckThread.py index 3df2553cf6995504709ce92797cb788e5bea95a4..d03f48201b7f9d6a1493ca9f182e0c4ffd917f89 100644 --- a/Script/CheckThread.py +++ b/Script/CheckThread.py @@ -32,6 +32,7 @@ class CheckThread(threading.Thread): self.ERS_enabled = self.conf.ERS_enabled self.partition = self.conf.partition self.LogLevel = self.conf.LogLevel + self.ERSTimeout = self.conf.ERSTimeout ##### Define Thread internal variables ##### self.exitFlag = False @@ -71,6 +72,7 @@ class CheckThread(threading.Thread): ##### Check for a new partition ##### if IPCPartition(self.partition).isValid() and not self.ers_flag: + self.event.wait(self.ERSTimeout) self.logInfo = {'file':self.check_logger.findCaller()[0],'line':self.check_logger.findCaller()[1]} self.check_logger.info('Found partition %s, adding ERS' % self.partition, extra = self.logInfo) self.ers_flag = True @@ -85,14 +87,8 @@ class CheckThread(threading.Thread): self.ers_flag = False ##### Remove ERS handlers from all loggers ##### self.change_state_ers(False) - - #print "checkloggers handlers", self.check_logger.handlers - #print "copythreads handlers", self.copy.logger.handlers - #print "del threads handlers", self.delete.logger.handlers - #print "managers handlers", self.manager.logger.handlers - #print "main's loggers handlers", self.logger.handlers - self.event.wait(self.CheckTimeout) + # end while # end def run() diff --git a/Script/Conf.cfg b/Script/Conf.cfg index 48c6f2a9d75b332ea67edf45ee8ea759053723e6..a915aef0d02a6c8a1fae7509a9a54da961cf8018 100755 --- a/Script/Conf.cfg +++ b/Script/Conf.cfg @@ -192,5 +192,8 @@ DeleteTimeout: 2 MigDelay: 600 ########## CHECK THREAD ########## -# Time between checks for partition -CheckTimeout: 2 +# Time (s) between checks for partition +CheckTimeout: 1 + +# Timout (s) before adding the ERS handler +ERSTimeout: 10 diff --git a/Script/Conf.py b/Script/Conf.py index bc1b74f875c64a4af3ab11dee2517f5029a12d2c..654a4bc3f1a92f41d7bf24bb32edf9376a78572c 100755 --- a/Script/Conf.py +++ b/Script/Conf.py @@ -211,3 +211,5 @@ class Conf: ########## CHECK THREAD ########## self.CheckTimeout = cfg.CheckTimeout + + self.ERSTimeout = cfg.ERSTimeout