agent: sync with NTP server when 'agent' starts

This commit is contained in:
Gyu-Ho Lee 2017-01-30 14:43:45 -08:00
parent 2397d51437
commit 6ad895afbe
No known key found for this signature in database
GPG Key ID: 1DDD39C7EB70C24C
1 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import (
"path/filepath"
"github.com/coreos/dbtester/agent/agentpb"
"github.com/coreos/dbtester/pkg/ntp"
"github.com/coreos/pkg/capnslog"
"github.com/gyuho/psn"
"github.com/spf13/cobra"
@ -91,6 +92,10 @@ var Command = &cobra.Command{
}
func commandFunc(cmd *cobra.Command, args []string) error {
no, nerr := ntp.DefaultSync()
plog.Infof("npt update output: %q", no)
plog.Infof("npt update error: %v", nerr)
f, err := openToAppend(globalFlags.agentLog)
if err != nil {
return err