Changed the order of things
All checks were successful
continuous-integration/drone/push Build is passing

also fixed spelling of amqp
This commit is contained in:
2021-07-28 15:13:44 +02:00
parent 414330b3d5
commit 3d423c71c6
4 changed files with 19 additions and 17 deletions

View File

@@ -11,12 +11,12 @@ from db import db
from marshm import ma
from influxus import influx_db
from resources import SampleResource, SampleParameterResource
from healthchecks import health_database_status, ampq_connection_status
from healthchecks import health_database_status, amqp_connection_status
import atexit
from apscheduler.schedulers.background import BackgroundScheduler
from magic_ampq import magic_ampq
from magic_amqp import magic_amqp
from error_handlers import register_all_error_handlers
"""
@@ -48,10 +48,10 @@ db.init_app(app)
ma.init_app(app)
# ampq magic stuff
magic_ampq.init_app(app)
magic_amqp.init_app(app)
ampq_loop_scheduler = BackgroundScheduler()
ampq_loop_scheduler.add_job(func=lambda: magic_ampq.loop(), trigger="interval", seconds=5)
ampq_loop_scheduler.add_job(func=lambda: magic_amqp.loop(), trigger="interval", seconds=5)
atexit.register(lambda: ampq_loop_scheduler.shutdown())
ampq_loop_scheduler.start()
@@ -71,7 +71,7 @@ api.add_resource(SampleResource, "/sample")
api.add_resource(SampleParameterResource, '/sample/<tag>')
health.add_check(health_database_status)
health.add_check(ampq_connection_status)
health.add_check(amqp_connection_status)
register_all_error_handlers(app)