perf: dashboard 默认6小时查询(减73%扫描行) + 7天自动清理 + 5分钟自动刷新
This commit is contained in:
1 parent
20f64e3851
commit
bc813e611c
2 files changed
+16
-1
No files matched your search
@@ -62,7 +62,7 @@ export function Dashboard() {
|
||||
console.error('Failed to fetch dashboard releases:', e);
|
||||
return null;
|
||||
}),
|
||||
dashboardStatsApi.getMetrics(24).catch((e) => {
|
||||
dashboardStatsApi.getMetrics(6).catch((e) => {
|
||||
console.error('Failed to fetch metrics:', e);
|
||||
return [];
|
||||
}),
|
||||
@@ -85,6 +85,9 @@ export function Dashboard() {
|
||||
|
||||
useEffect(() => {
|
||||
refreshData();
|
||||
// 每 5 分钟自动刷新
|
||||
const interval = setInterval(refreshData, 5 * 60 * 1000);
|
||||
return () => clearInterval(interval);
|
||||
}, [refreshData]);
|
||||
|
||||
if (initialLoading) {
|
||||
|
||||
Reference in new issue
Block a user