Skip to content

Commit

Permalink
Fixes to driver exception handling related to bacnet pings and heartb…
Browse files Browse the repository at this point in the history
…eats.
  • Loading branch information
davidraker committed Apr 19, 2024
1 parent e5c1962 commit b6d29ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion services/core/PlatformDriverAgent/platform_driver/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ def heart_beat(self):
"""
_log.debug("sending heartbeat")
for device in self.instances.values():
device.heart_beat()
try:
device.heart_beat()
except (Exception, gevent.Timeout) as e:
_log.warning(f'Failed to set heart_beat point on device: {device.device_name} -- {e}.')

@RPC.export
def revert_point(self, path, point_name, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# ===----------------------------------------------------------------------===
# }}}


import gevent
import logging
from datetime import datetime, timedelta

Expand Down Expand Up @@ -98,9 +98,8 @@ def ping_target(self):
pinged = True
except errors.Unreachable:
_log.warning("Unable to reach BACnet proxy.")

except errors.VIPError:
_log.warning("Error trying to ping device.")
except (Exception, gevent.Timeout) as e:
_log.warning(f"Error trying to ping device: {e}")

self.scheduled_ping = None

Expand Down

0 comments on commit b6d29ad

Please sign in to comment.