add more ntp servers (#3890)

* add more ntp servers to improve stability

* bump version
This commit is contained in:
frank 2023-08-16 10:06:03 +08:00 committed by GitHub
parent e7f5f32298
commit 864b0686d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -1 +1 @@
0.163.10 0.163.11

View File

@ -14,7 +14,7 @@ import (
const ( const (
// DefaultMaxAllowedFailures defines how many failures will be tolerated. // DefaultMaxAllowedFailures defines how many failures will be tolerated.
DefaultMaxAllowedFailures = 1 DefaultMaxAllowedFailures = 4
// FastNTPSyncPeriod period between ntp synchronizations before the first // FastNTPSyncPeriod period between ntp synchronizations before the first
// successful connection. // successful connection.
@ -31,10 +31,14 @@ const (
// defaultServers will be resolved to the closest available, // defaultServers will be resolved to the closest available,
// and with high probability resolved to the different IPs // and with high probability resolved to the different IPs
var defaultServers = []string{ var defaultServers = []string{
"0.pool.ntp.org", "time.apple.com",
"1.pool.ntp.org", "pool.ntp.org",
"2.pool.ntp.org", "time.cloudflare.com",
"3.pool.ntp.org", "time.windows.com",
"ntp.neu.edu.cn",
"ntp.nict.jp",
"amazon.pool.ntp.org",
"android.pool.ntp.org",
} }
var errUpdateOffset = errors.New("failed to compute offset") var errUpdateOffset = errors.New("failed to compute offset")