1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2024-11-22 08:07:30 +00:00

Remove debugging info from getIdentifier

This commit is contained in:
Cadence Ember 2020-07-31 03:01:54 +12:00
parent 4fdf44c4ca
commit f0a28d485f
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412

View File

@ -33,21 +33,16 @@ if (constants.quota.enabled) {
} }
function getIdentifier(address) { function getIdentifier(address) {
let d = Date.now() try {
const result = (() => { if (address == undefined) return "missing"
try { else if (checker(address)) return "proxy"
if (address == undefined) return "missing" else if (addressSet.has(address)) return "proxy"
else if (checker(address)) return "proxy" else return address
else if (addressSet.has(address)) return "proxy" } catch (e) {
else return address // not a valid IP address, or some error like that
} catch (e) { console.error(e)
// not a valid IP address, or some error like that throw e
console.error(e) }
throw e
}
})()
console.log(`identified ${address} -> ${result} in ${Date.now()-d} ms`)
return result
} }
module.exports.getIdentifier = getIdentifier module.exports.getIdentifier = getIdentifier