catch server error for influx
This commit is contained in:
parent
af0cb3bff6
commit
7ec28e51fc
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
from logging import getLogger
|
||||
from influxdb import InfluxDBClient
|
||||
from influxdb.exceptions import InfluxDBServerError
|
||||
|
||||
|
||||
class DBManager(object):
|
||||
|
@ -21,4 +22,8 @@ class DBManager(object):
|
|||
def write_points(self, data):
|
||||
d = data
|
||||
self.logger.debug('Writing Data to InfluxDB %s', d)
|
||||
self.influx.write_points(d)
|
||||
try:
|
||||
self.influx.write_points(d)
|
||||
except InfluxDBServerError as e:
|
||||
self.logger.error('Error writing data to influxdb. Dropping this set of data. Check your database! Error: '
|
||||
'%s', e)
|
||||
|
|
Loading…
Reference in a new issue