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:
parent
4fdf44c4ca
commit
f0a28d485f
@ -33,21 +33,16 @@ if (constants.quota.enabled) {
|
||||
}
|
||||
|
||||
function getIdentifier(address) {
|
||||
let d = Date.now()
|
||||
const result = (() => {
|
||||
try {
|
||||
if (address == undefined) return "missing"
|
||||
else if (checker(address)) return "proxy"
|
||||
else if (addressSet.has(address)) return "proxy"
|
||||
else return address
|
||||
} catch (e) {
|
||||
// not a valid IP address, or some error like that
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
})()
|
||||
console.log(`identified ${address} -> ${result} in ${Date.now()-d} ms`)
|
||||
return result
|
||||
try {
|
||||
if (address == undefined) return "missing"
|
||||
else if (checker(address)) return "proxy"
|
||||
else if (addressSet.has(address)) return "proxy"
|
||||
else return address
|
||||
} catch (e) {
|
||||
// not a valid IP address, or some error like that
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.getIdentifier = getIdentifier
|
||||
|
Loading…
Reference in New Issue
Block a user