Skip to content
Snippets Groups Projects
Commit b94e8ad0 authored by Rebecca Ewing's avatar Rebecca Ewing Committed by Rebecca Ewing
Browse files

gstlal_ll_inspiral_event_uploader: rename duplicated heartbeat variable

parent 7020f6a3
No related branches found
No related tags found
1 merge request!530O4a online monitoring
......@@ -157,7 +157,7 @@ class EventUploader(events.EventProcessor):
self.upload_topic = f'gstlal.{self.tag}.{topic_prefix}uploads'
### heartbeat settings
self.last_heartbeat = 0.0
self.last_inspiral_heartbeat = 0.0
self.heartbeat_write = inspiral.now()
### set up aggregator sink
......@@ -175,8 +175,8 @@ class EventUploader(events.EventProcessor):
### process heartbeat messages from inspiral jobs
if message.key() and 'heartbeat' == message.key().decode('UTF-8'):
heartbeat = json.loads(message.value())
if heartbeat['time'] > self.last_heartbeat:
self.last_heartbeat = heartbeat['time']
if heartbeat['time'] > self.last_inspiral_heartbeat:
self.last_inspiral_heartbeat = heartbeat['time']
### process candidate event
else:
......@@ -309,7 +309,7 @@ class EventUploader(events.EventProcessor):
# jobs should send heartbeats every 10 minutes
now = inspiral.now()
if now - self.heartbeat_write > 15*60:
state = 0 if now - self.last_heartbeat > 15*60 else 1
state = 0 if now - self.last_inspiral_heartbeat > 15*60 else 1
data = {'heartbeat': {'heartbeat_tag': {'time': [int(now)], 'fields': {'data': [state]}}}}
logging.debug(f'Storing heartbeat state {state} to influx...')
......
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