File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 22Routes for the dashboard.
33"""
44
5+ import logging
6+ import pandas as pd
57from fasthtml .common import *
68from monsterui .all import *
79from fasthtml .svg import *
1315from charts import ChartManager
1416
1517
18+ log = logging .getLogger ("anomstack" )
19+
20+
1621@rt
1722def index (request : Request ):
1823 """
@@ -34,9 +39,13 @@ def index(request: Request):
3439 batch_stats = {}
3540 for batch_name in app .state .metric_batches :
3641 if batch_name not in app .state .df_cache :
37- df = get_data (
38- app .state .specs_enabled [batch_name ], max_n = DEFAULT_ALERT_MAX_N
39- )
42+ try :
43+ df = get_data (
44+ app .state .specs_enabled [batch_name ], max_n = DEFAULT_ALERT_MAX_N
45+ )
46+ except Exception as e :
47+ log .error (f"Error getting data for batch { batch_name } : { e } " )
48+ df = pd .DataFrame ()
4049 app .state .df_cache [batch_name ] = df
4150 else :
4251 df = app .state .df_cache [batch_name ]
You can’t perform that action at this time.
0 commit comments