Skip to content
Snippets Groups Projects

Resolve "Initial Publish uptime of CS instance to IS"

1 file
+ 13
11
Compare changes
  • Side-by-side
  • Inline
@@ -63,20 +63,22 @@ class InfoServiceThread(threading.Thread):
@@ -63,20 +63,22 @@ class InfoServiceThread(threading.Thread):
def send_update(self):
def send_update(self):
try:
try:
self.logger.debug("Getting state from IS")
is_data_type = "Double"
 
is_data_identifier = "RunParams.{}.State".format(self.tdaq_app_name)
 
self.logger.debug("Retrieving: {}, type: {}, from IS".format(is_data_identifier,is_data_type))
# Note that we have to specify the type here
is_data = ispy.ISObject(self.ipc_partition, is_data_identifier, is_data_type)
cs_state = ISObject(self.ipc_partition,"RunParams.{}.State".format(self.tdaq_app_name), 'CastorScriptState')
if cs_state.exists():
if is_data.exists():
cs_state.checkout()
is_data.checkout()
print cs_state
print("found: {}".format(is_data))
else:
else:
print(cs_state.name() + " does not exist")
print(is_data.name() + " does not exist")
cs_state.uptime_seconds = self.uptime_seconds
is_data.value = self.uptime_seconds
cs_state.checkin()
is_data.checkin()
self.logger.debug("Update sent: %s", str(cs_state))
self.logger.debug("Update sent: %s", str(is_data))
 
self.logger.info("TEST Update sent: %s", str(is_data))
except Exception as ex:
except Exception as ex:
self.logger.warning("Error occured while trying to change cs_state to tdaq_app_name=%s uptime_seconds=%d. Error was: %s",self.tdaq_app_name, self.uptime_seconds, str(ex))
self.logger.warning("Error occured while trying to change is_data to uptime_seconds=%d. Error was: %s", self.uptime_seconds, str(ex))
Loading