26 lines
545 B
Python
26 lines
545 B
Python
# plugins/traefik/__init__.py
|
|
from __future__ import annotations
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from quart import Quart
|
|
|
|
_app: "Quart | None" = None
|
|
|
|
|
|
def setup(app: "Quart") -> None:
|
|
global _app
|
|
_app = app
|
|
# Import model to register with SQLAlchemy metadata
|
|
from .models import TraefikMetric # noqa: F401
|
|
|
|
|
|
def get_scheduled_tasks() -> list:
|
|
from .scheduler import make_scrape_task
|
|
return [make_scrape_task(_app)]
|
|
|
|
|
|
def get_blueprint():
|
|
from .routes import traefik_bp
|
|
return traefik_bp
|