mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-01 13:53:11 +08:00
cleanup
This commit is contained in:
10
lib/utils.ts
10
lib/utils.ts
@@ -64,10 +64,12 @@ export const testUrls = async (urls?: string[]) => {
|
||||
if (!urls?.length) {
|
||||
return null;
|
||||
}
|
||||
const ret = await promiseAny(urls.map(ping));
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
try {
|
||||
const ret = await promiseAny(urls.map(ping));
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
} catch {}
|
||||
logger('all ping failed, use first url:', urls[0]);
|
||||
return urls[0];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user