all: wait NTP synced on Merlin

On some Merlin routers, the time is broken when system reboot, and need
to wait for NTP synced to get the correct time. For fetching API in cd
mode successfully, ctrld need to wait until NTP set the time correctly,
otherwise, the certificate validation would complain.
This commit is contained in:
Cuong Manh Le
2023-05-09 23:11:53 +07:00
committed by Cuong Manh Le
parent d75f871541
commit 9689607409
2 changed files with 57 additions and 0 deletions
+7
View File
@@ -173,6 +173,13 @@ func initCLI() {
// Log config do not have thing to validate, so it's safe to init log here,
// so it's able to log information in processCDFlags.
initLogging()
if setupRouter {
if err := router.PreStart(); err != nil {
mainLog.Fatal().Err(err).Msg("failed to perform router pre-start check")
}
}
processCDFlags()
if err := ctrld.ValidateConfig(validator.New(), &cfg); err != nil {
mainLog.Fatal().Msgf("invalid config: %v", err)