fix: 优化测速

pull/192/head
xiaojunnuo 2021-12-23 23:04:47 +08:00
parent 732458b863
commit e8d9613139
1 changed files with 3 additions and 5 deletions

View File

@ -81,11 +81,9 @@ class SpeedTester {
}
async test () {
if (this.backupList.length === 0 || this.testCount < 15 || this.testCount % 5 === 0) {
const newList = await this.getIpListFromDns(this.dnsMap)
const newBackupList = [...newList, ...this.backupList]
this.backupList = _.unionBy(newBackupList, 'host')
}
const newList = await this.getIpListFromDns(this.dnsMap)
const newBackupList = [...newList, ...this.backupList]
this.backupList = _.unionBy(newBackupList, 'host')
this.testCount++
log.info('[speed]', this.hostname, ' ips:', this.backupList)