mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-05 12:22:28 +00:00
Avoid trusted seed retry blocking app startup
This commit is contained in:
1 parent
9310929f0d
commit
40e8f436e6
1 file changed
+13
-4
Vendored
+13
-4
@@ -144,18 +144,27 @@ async function bootstrapTrustedSeeds() {
|
||||
}
|
||||
};
|
||||
|
||||
let hydrateResult = await hydrate();
|
||||
const hydrateResult = await hydrate();
|
||||
|
||||
const runAsyncRetry = async () => {
|
||||
if (hydrateResult?.ok || attempts >= 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hydrateResult?.ok && attempts < 2) {
|
||||
const relaysReady = await waitForRelaysReady();
|
||||
if (relaysReady) {
|
||||
hydrateResult = await hydrate();
|
||||
await hydrate();
|
||||
} else {
|
||||
devLogger.warn(
|
||||
"[bootstrap] Skipping trusted seed retry because relays were not ready in time.",
|
||||
);
|
||||
applySeeds();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
runAsyncRetry().catch((error) => {
|
||||
userLogger.warn("[bootstrap] Trusted seed retry failed", error);
|
||||
});
|
||||
|
||||
if (!hydrateResult?.ok) {
|
||||
applySeeds();
|
||||
|
||||
Reference in new issue
Block a user