Last fixes
This commit is contained in:
parent
a2f6ac6fb6
commit
cb856ccee1
1 changed files with 2 additions and 7 deletions
|
|
@ -8,7 +8,6 @@ const { MAIN, CYCLES } = require('../config.js').CONFIG;
|
|||
|
||||
const ipAddresses = new Set();
|
||||
let ipv6ErrorCount = 0, ipv6ErrorLogged = false;
|
||||
const IPv6Failed = 'It looks like your ISP hasn\'t assigned you any IPv6 address. I won\'t attempt to fetch it again.';
|
||||
|
||||
const fetchIPAddress = async family => {
|
||||
if (family === 6 && (ipv6ErrorLogged || !MAIN.IPv6_SUPPORT)) return;
|
||||
|
|
@ -22,11 +21,7 @@ const fetchIPAddress = async family => {
|
|||
ipAddresses.add(data.message);
|
||||
|
||||
if (family === 6) {
|
||||
if (ipv6ErrorCount > 0) {
|
||||
const IPv6Success = `Uh, it looks like IPv6 has started working! It only succeeded after ${ipv6ErrorCount} attempts.`;
|
||||
log(0, IPv6Success);
|
||||
}
|
||||
|
||||
if (ipv6ErrorCount > 0) log(0, `Uh, it looks like IPv6 has started working! It only succeeded after ${ipv6ErrorCount} attempts.`);
|
||||
ipv6ErrorCount = 0;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -40,7 +35,7 @@ const fetchIPAddress = async family => {
|
|||
|
||||
if (ipv6ErrorCount >= 6 && !ipv6ErrorLogged) {
|
||||
ipv6ErrorLogged = true;
|
||||
log(0, IPv6Failed);
|
||||
log(0, 'It looks like your ISP hasn\'t assigned you any IPv6 address. I won\'t attempt to fetch it again.');
|
||||
} else {
|
||||
await new Promise(resolve => setTimeout(resolve, 4000));
|
||||
await fetchIPAddress(6);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue