Skip to content

Commit

Permalink
avoid edge case influxdb parsing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Mar 8, 2024
1 parent b290107 commit 22644c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gcp/python/InfluxDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ def WriteDB(fr, client, fields=None):
except Exception as e:
core.log_error("Error converting time: {}".format(str(e)), unit="InfluxDB")
continue
# Avoid out-of-range errors in parsing time
# time < 0 occurs when, e.g., the SCU loses the clock (e.g. during a brownout)
time[time < 0] = 0
if dat is None:
core.log_warn('{} dat is None'.format(f), unit='InfluxDB')
continue
Expand Down

0 comments on commit 22644c1

Please sign in to comment.