perf: increase background loading interval to 2000ms
This commit is contained in:
+2
-2
@@ -678,8 +678,8 @@ async function loadAllCitiesProgressively(cities) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(`Background load failed for ${city.name}`, e);
|
console.warn(`Background load failed for ${city.name}`, e);
|
||||||
}
|
}
|
||||||
// 间隔 800ms,避免瞬间并发轰炸后端 API
|
// 间隔 2000ms,避免瞬间并发轰炸后端 API,且让出浏览器主线程
|
||||||
await new Promise((r) => setTimeout(r, 800));
|
await new Promise((r) => setTimeout(r, 2000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user