From 864b0686d2195620c97210d4968be27d438d64b9 Mon Sep 17 00:00:00 2001 From: frank Date: Wed, 16 Aug 2023 10:06:03 +0800 Subject: [PATCH] add more ntp servers (#3890) * add more ntp servers to improve stability * bump version --- VERSION | 2 +- timesource/timesource.go | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index f61ca7c60..9704c9bc9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.163.10 +0.163.11 diff --git a/timesource/timesource.go b/timesource/timesource.go index 477b56598..fd010fbc6 100644 --- a/timesource/timesource.go +++ b/timesource/timesource.go @@ -14,7 +14,7 @@ import ( const ( // DefaultMaxAllowedFailures defines how many failures will be tolerated. - DefaultMaxAllowedFailures = 1 + DefaultMaxAllowedFailures = 4 // FastNTPSyncPeriod period between ntp synchronizations before the first // successful connection. @@ -31,10 +31,14 @@ const ( // defaultServers will be resolved to the closest available, // and with high probability resolved to the different IPs var defaultServers = []string{ - "0.pool.ntp.org", - "1.pool.ntp.org", - "2.pool.ntp.org", - "3.pool.ntp.org", + "time.apple.com", + "pool.ntp.org", + "time.cloudflare.com", + "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")