fix(health-agent): reload uk_tokens.yml on every push call instead of caching at startup
This commit is contained in:
parent
0551b01c64
commit
fa7ed41063
@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
import logging
|
import logging
|
||||||
from health_agent.config import UK_TOKENS
|
from health_agent.config import load_uk_tokens
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
UK_PUSH_URL_BASE = os.getenv("UK_PUSH_URL_BASE", "https://uptime.tarla.io/api/push")
|
UK_PUSH_URL_BASE = os.getenv("UK_PUSH_URL_BASE", "https://uptime.tarla.io/api/push")
|
||||||
@ -9,7 +9,7 @@ UK_PUSH_URL_BASE = os.getenv("UK_PUSH_URL_BASE", "https://uptime.tarla.io/api/pu
|
|||||||
DRY_RUN = False
|
DRY_RUN = False
|
||||||
|
|
||||||
def push(monitor_name: str, status: str, msg: str, ping_ms: int):
|
def push(monitor_name: str, status: str, msg: str, ping_ms: int):
|
||||||
token = UK_TOKENS.get(monitor_name)
|
token = load_uk_tokens().get(monitor_name)
|
||||||
if not token:
|
if not token:
|
||||||
logger.warning(f"No token found for monitor {monitor_name}")
|
logger.warning(f"No token found for monitor {monitor_name}")
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user