made InfluxDB optional
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -118,20 +118,21 @@ class SampleResource(Resource):
|
||||
current_app.logger.exception(e)
|
||||
return abort(569, "AMPQ Publish error")
|
||||
|
||||
influx_db.write_points(
|
||||
[
|
||||
{
|
||||
'time': datetime.now(tz=tzlocal.get_localzone()),
|
||||
'measurement': 'cloudinput',
|
||||
'tags': {
|
||||
'device': desc['device_id']
|
||||
},
|
||||
'fields': {
|
||||
'bruh': 1.0
|
||||
if current_app.config['ENABLE_INFLUXDB']:
|
||||
influx_db.write_points(
|
||||
[
|
||||
{
|
||||
'time': datetime.now(tz=tzlocal.get_localzone()),
|
||||
'measurement': 'cloudinput',
|
||||
'tags': {
|
||||
'device': desc['device_id']
|
||||
},
|
||||
'fields': {
|
||||
'bruh': 1.0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
db.session.commit()
|
||||
return {"tag": generated_tag}, 200
|
||||
|
||||
Reference in New Issue
Block a user