Skip to content
Snippets Groups Projects
Commit 18d62ec9 authored by Jonas's avatar Jonas
Browse files

Rename: CheckThread self.ers_flag => self.partition_connected

parent b0a20a2b
No related branches found
No related tags found
1 merge request!23Resolve "Logging implementation cleanup"
...@@ -38,7 +38,7 @@ class CheckThread(threading.Thread): ...@@ -38,7 +38,7 @@ class CheckThread(threading.Thread):
##### Define Thread internal variables ##### ##### Define Thread internal variables #####
self.exitFlag = False self.exitFlag = False
self.ers_flag = True self.partition_connected = True
##### Set Logger for CheckThread ##### ##### Set Logger for CheckThread #####
self.logFile = os.path.join(self.LogDir,'CheckLog.out') self.logFile = os.path.join(self.LogDir,'CheckLog.out')
...@@ -74,17 +74,17 @@ class CheckThread(threading.Thread): ...@@ -74,17 +74,17 @@ class CheckThread(threading.Thread):
return return
##### Check for a new partition ##### ##### Check for a new partition #####
if self.IPCPartition(self.partition).isValid() and not self.ers_flag: if self.IPCPartition(self.partition).isValid() and not self.partition_connected:
self.event.wait(self.ERSTimeout) self.event.wait(self.ERSTimeout)
self.check_logger.warning('Found partition %s, adding ERS', self.partition) self.check_logger.warning('Found partition %s, adding ERS', self.partition)
self.ers_flag = True self.partition_connected = True
##### Add ERS handlers to all loggers ##### ##### Add ERS handlers to all loggers #####
self.change_state_ers(True) self.change_state_ers(True)
##### Check for the disappearance of partition ##### ##### Check for the disappearance of partition #####
elif self.ers_flag and not self.IPCPartition(self.partition).isValid(): elif self.partition_connected and not self.IPCPartition(self.partition).isValid():
self.check_logger.warning('Lost connection to partition %s, removing ERS handlers', self.partition) self.check_logger.warning('Lost connection to partition %s, removing ERS handlers', self.partition)
self.ers_flag = False self.partition_connected = False
##### Remove ERS handlers from all loggers ##### ##### Remove ERS handlers from all loggers #####
self.change_state_ers(False) self.change_state_ers(False)
self.event.wait(self.CheckTimeout) self.event.wait(self.CheckTimeout)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment