Reduce the request frequency to the Binance API and add backend caching.

This commit is contained in:
SkywalkerJi
2025-10-30 14:01:06 +08:00
parent 72098251d1
commit 27bd26c8a6
6 changed files with 89 additions and 21 deletions

View File

@@ -50,7 +50,11 @@ export default function AILearning({ traderId }: AILearningProps) {
const { data: performance, error } = useSWR<PerformanceAnalysis>(
traderId ? `performance-${traderId}` : 'performance',
() => api.getPerformance(traderId),
{ refreshInterval: 10000 }
{
refreshInterval: 30000, // 30秒刷新AI学习分析数据更新频率较低
revalidateOnFocus: false,
dedupingInterval: 20000,
}
);
if (error) {