add ability to skip unfurlSrv calls to avoid ping cost
This commit is contained in:
parent
ac06ae884e
commit
a3c88dc0c5
@ -9,6 +9,9 @@
|
||||
"pingAll": 3000,
|
||||
"connectTimeout": 2500
|
||||
},
|
||||
"performance": {
|
||||
"skipUnfurlSrv": false
|
||||
},
|
||||
"logToDatabase": false,
|
||||
"graphDuration": 86400000
|
||||
}
|
||||
|
@ -54,6 +54,11 @@ function ping (host, port, type, timeout, callback, version) {
|
||||
}
|
||||
|
||||
function unfurlSrv (hostname, port, callback) {
|
||||
if (config.performance && config.performance.skipUnfurlSrv) {
|
||||
callback(hostname, port)
|
||||
return
|
||||
}
|
||||
|
||||
dns.resolveSrv('_minecraft._tcp.' + hostname, (_, records) => {
|
||||
if (!records || records.length < 1) {
|
||||
callback(hostname, port)
|
||||
|
4
main.js
4
main.js
@ -25,6 +25,10 @@ servers.forEach((server, serverId) => {
|
||||
app.serverRegistrations.push(new ServerRegistration(serverId, server))
|
||||
})
|
||||
|
||||
if (config.performance && config.performance.skipUnfurlSrv) {
|
||||
logger.log('warn', '"performance.skipUnfurlSrv" is enabled. Any configured hosts using SRV records may not properly resolve.')
|
||||
}
|
||||
|
||||
if (!config.logToDatabase) {
|
||||
logger.log('warn', 'Database logging is not enabled. You can enable it by setting "logToDatabase" to true in config.json. This requires sqlite3 to be installed.')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user