Merge pull request #243 from cnxysoft/upmain

fix: 框架启动概率性失败
This commit is contained in:
手瓜一十雪 2024-08-13 13:50:08 +08:00 committed by GitHub
commit 62e0c57a50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,7 +107,13 @@ function registerInitCallback(callback) {
async function fetchServices(timeout = 10000) { async function fetchServices(timeout = 10000) {
return Promise.race([ return Promise.race([
pollForNTInitializationCheck(), new Promise((resolve) => {
setTimeout(() => {
pollForNTInitializationCheck().then(() => {
resolve(true);
});
});
}),
new Promise((resolve) => { new Promise((resolve) => {
setTimeout(() => resolve(false), timeout); setTimeout(() => resolve(false), timeout);
}), }),