Use MONGODB_HOST env var because Wildduck uses that

master
Lauri Võsandi 2 years ago
parent 317978c24a
commit a616c0b38a
  1. 8
      wildduck_exporter.py

@ -3,9 +3,9 @@ import os
from motor.motor_asyncio import AsyncIOMotorClient
from sanic import Sanic, response, exceptions
MONGO_URI = os.getenv("MONGO_URI")
if not MONGO_URI:
raise ValueError("No MONGO_URI specified")
MONGODB_HOST = os.getenv("MONGODB_HOST")
if not MONGODB_HOST:
raise ValueError("No MONGODB_HOST specified")
PROMETHEUS_BEARER_TOKEN = os.getenv("PROMETHEUS_BEARER_TOKEN")
if not PROMETHEUS_BEARER_TOKEN:
@ -16,7 +16,7 @@ app = Sanic("exporter")
@app.listener("before_server_start")
async def setup_db(app, loop):
app.ctx.db = AsyncIOMotorClient(MONGO_URI).get_default_database()
app.ctx.db = AsyncIOMotorClient(MONGODB_HOST).get_default_database()
async def wrap(i, prefix="wildduck_"):

Loading…
Cancel
Save