mirror of
https://github.com/tsightler/ring-mqtt.git
synced 2025-10-16 13:50:54 +08:00
Release 4.8.2
This commit is contained in:
@@ -35,7 +35,7 @@ class Utils
|
||||
async getHostFqdn() {
|
||||
const pLookupService = promisify(dns.lookupService)
|
||||
try {
|
||||
return await (pLookupService(await this.getHostIp(), 0)).hostname
|
||||
return (await pLookupService(await this.getHostIp(), 0)).hostname
|
||||
} catch {
|
||||
console.log('Failed to resolve FQDN, using os.hostname() instead')
|
||||
return os.hostname()
|
||||
@@ -45,7 +45,7 @@ class Utils
|
||||
async getHostIp() {
|
||||
const pLookup = promisify(dns.lookup)
|
||||
try {
|
||||
return await (pLookup(os.hostname())).address
|
||||
return (await pLookup(os.hostname())).address
|
||||
} catch {
|
||||
console.log('Failed to resolve hostname IP address, returning localhost instead')
|
||||
return 'localhost'
|
||||
|
Reference in New Issue
Block a user