Added error catching for KeyError for Influx.
This commit is contained in:
parent
1f96e10f76
commit
978dd0dc5d
@ -30,7 +30,7 @@ TEMPSETING = bool(os.getenv("TEMPSETING", True))
|
||||
|
||||
PROCESSTEMPWAITTIME = float(os.getenv("PROCESSTEMPWAITTIME", 0.75))
|
||||
|
||||
BACKOFFTIME = float(os.getenv("BACKOFFTIME", 0.1))
|
||||
BACKOFFTIME = float(os.getenv("BACKOFFTIME", 5))
|
||||
|
||||
# INFLUXDB config
|
||||
# token = "apg1gysUeCcxdcRTMmosJTenbEppmUNi9rXlANDB2oNadBdWAu2GVTDc_q_dyo0iyYsckKaOvPRm6ba2NK0y_A=="
|
||||
@ -195,18 +195,22 @@ def process_temps():
|
||||
# ---LeData---
|
||||
if fluxSending:
|
||||
# Prep InfluxDB data
|
||||
inflxdb_Data_To_Send = (
|
||||
influxdb_client.Point(f"{measurement}-script")
|
||||
.tag("MACHINE", MACHINE_TAG)
|
||||
.tag("LOCATION", LOCATION)
|
||||
.field("Backplane1", MDict["bp1"])
|
||||
.field("Backplane2", MDict["bp2"])
|
||||
.field("SASIntModule0", MDict["sim0"])
|
||||
.field("SASIntModule1", MDict["sim1"])
|
||||
.field("Expander0", MDict["exp0"])
|
||||
.field("Expander1", MDict["exp1"])
|
||||
.field("Average", MDict["avg"])
|
||||
)
|
||||
try:
|
||||
inflxdb_Data_To_Send = (
|
||||
influxdb_client.Point(f"{measurement}-script")
|
||||
.tag("MACHINE", MACHINE_TAG)
|
||||
.tag("LOCATION", LOCATION)
|
||||
.field("Backplane1", MDict["bp1"])
|
||||
.field("Backplane2", MDict["bp2"])
|
||||
.field("SASIntModule0", MDict["sim0"])
|
||||
.field("SASIntModule1", MDict["sim1"])
|
||||
.field("Expander0", MDict["exp0"])
|
||||
.field("Expander1", MDict["exp1"])
|
||||
.field("Average", MDict["avg"])
|
||||
)
|
||||
except KeyError:
|
||||
time.sleep(BACKOFFTIME)
|
||||
continue
|
||||
|
||||
# Prep/append data
|
||||
inflxdb_LeData.append(inflxdb_Data_To_Send)
|
||||
|
Loading…
x
Reference in New Issue
Block a user