Fix metrics store access
This commit is contained in:
@@ -9,7 +9,8 @@ from services.http_checks import get_url_checks, check_url
|
||||
from services.queue import enqueue
|
||||
from services.updates import list_updates, apply_updates
|
||||
from services.runner import run_cmd
|
||||
from state import UPDATES_CACHE, REBOOT_PENDING, METRICS_STORE
|
||||
import state
|
||||
from state import UPDATES_CACHE, REBOOT_PENDING
|
||||
from services.metrics import summarize
|
||||
|
||||
|
||||
@@ -60,10 +61,10 @@ async def urls(msg: Message):
|
||||
async def metrics(msg: Message):
|
||||
if not is_admin_msg(msg):
|
||||
return
|
||||
if METRICS_STORE is None:
|
||||
if state.METRICS_STORE is None:
|
||||
await msg.answer("⚠️ Metrics not initialized", reply_markup=system_kb)
|
||||
return
|
||||
await msg.answer(summarize(METRICS_STORE, minutes=15), reply_markup=system_kb)
|
||||
await msg.answer(summarize(state.METRICS_STORE, minutes=15), reply_markup=system_kb)
|
||||
|
||||
|
||||
@dp.message(F.text == "📦 Updates")
|
||||
|
||||
Reference in New Issue
Block a user