Don't read from app.Version before we initialise it, otherwise we report 'dev' back to the checkpoint service.

This commit is contained in:
Tom Wilkie
2016-03-12 11:01:52 +00:00
parent c6bd583a35
commit 5886dae974

View File

@@ -48,6 +48,11 @@ func appMain() {
defer log.Info("app exiting")
rand.Seed(time.Now().UnixNano())
app.UniqueID = strconv.FormatInt(rand.Int63(), 16)
app.Version = version
log.Infof("app starting, version %s, ID %s", app.Version, app.UniqueID)
// Start background version checking
checkpoint.CheckInterval(&checkpoint.CheckParams{
Product: "scope-app",
@@ -61,11 +66,6 @@ func appMain() {
}
})
rand.Seed(time.Now().UnixNano())
app.UniqueID = strconv.FormatInt(rand.Int63(), 16)
app.Version = version
log.Infof("app starting, version %s, ID %s", app.Version, app.UniqueID)
// If user supplied a weave router address, periodically try and register
// out IP address in WeaveDNS.
if *weaveAddr != "" {