Skip to content

Commit

Permalink
Changed logic so session data is always published
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryce Bixler committed Oct 8, 2024
1 parent 8dd0d2d commit 6be7815
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions socs/agents/hwp_pid/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,15 @@ def _get_data_and_publish(self, pid: pd.PID, session: ocs_agent.OpSession):

pid_state = get_pid_state(pid)
if pid_state['healthy']:
data['data'].update(pid_state['state'])
session.data.update(pid_state['state'])
session.data['last_updated'] = time.time()
self.agent.publish_to_feed("hwppid", data)
pid_state['state'].update({'quality': 'ok'})
else:
print('Warning: state monitor degraded')
pid_state['state'].update({'quality': 'degraded'})

data['data'].update(pid_state['state'])
session.data.update(pid_state['state'])
session.data['last_updated'] = time.time()
self.agent.publish_to_feed("hwppid", data)

def _process_actions(self, pid):
while not self.action_queue.empty():
Expand Down

0 comments on commit 6be7815

Please sign in to comment.