|
|
@ -283,7 +283,6 @@ class LokiMessageAPI {
|
|
|
|
!stopPollingResult &&
|
|
|
|
!stopPollingResult &&
|
|
|
|
successiveFailures < MAX_ACCEPTABLE_FAILURES
|
|
|
|
successiveFailures < MAX_ACCEPTABLE_FAILURES
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
await sleepFor(successiveFailures * 1000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Revert back to using snode address instead of IP
|
|
|
|
// TODO: Revert back to using snode address instead of IP
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -337,6 +336,10 @@ class LokiMessageAPI {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
successiveFailures += 1;
|
|
|
|
successiveFailures += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Always wait a bit as we are no longer long-polling
|
|
|
|
|
|
|
|
await sleepFor(Math.max(successiveFailures, 2) * 1000);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (successiveFailures >= MAX_ACCEPTABLE_FAILURES) {
|
|
|
|
if (successiveFailures >= MAX_ACCEPTABLE_FAILURES) {
|
|
|
|
const remainingSwarmSnodes = await lokiSnodeAPI.unreachableNode(
|
|
|
|
const remainingSwarmSnodes = await lokiSnodeAPI.unreachableNode(
|
|
|
@ -374,9 +377,6 @@ class LokiMessageAPI {
|
|
|
|
const options = {
|
|
|
|
const options = {
|
|
|
|
timeout: 40000,
|
|
|
|
timeout: 40000,
|
|
|
|
ourPubKey: this.ourKey,
|
|
|
|
ourPubKey: this.ourKey,
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
[LOKI_LONGPOLL_HEADER]: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// let exceptions bubble up
|
|
|
|
// let exceptions bubble up
|
|
|
|