add influx capability
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-06-13 20:01:23 +02:00
parent 92884b6760
commit 211be6cf96
6 changed files with 51 additions and 4 deletions

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python3
import logging
from flask import Flask
from flask_restful import Api
import sentry_sdk
@ -10,6 +9,7 @@ from healthcheck import HealthCheck
from config import *
from db import db
from marshm import ma
from influxus import influx_db
from resources import SampleResource, SampleParameterResource
from healthchecks import health_database_status
@ -42,10 +42,17 @@ app.config['FLASK_PIKA_PARAMS'] = {'host': RABBITMQ_HOST,
'password': RABBITMQ_PASSWORD,
'port': 5672,
'virtual_host': '/'}
app.config['INFLUXDB_HOST']=INFLUXDB_HOST
app.config['INFLUXDB_PORT']=INFLUXDB_PORT
app.config['INFLUXDB_USER']=INFLUXDB_USERNAME
app.config['INFLUXDB_PASSWORD']=INFLUXDB_PASSWORD
app.config['INFLUXDB_DATABASE']=INFLUXDB_DB
api = Api(app)
health = HealthCheck()
db.init_app(app)
ma.init_app(app)
influx_db.init_app(app)
with app.app_context():
db.create_all()