+17
-16
@@ -121,6 +121,10 @@ func (a *App) Start() error {
|
||||
}
|
||||
|
||||
func (a *App) startup() error {
|
||||
if cfgService, ok := a.cfg.(suture.Service); ok {
|
||||
a.mainService.Add(cfgService)
|
||||
}
|
||||
|
||||
a.mainService.Add(ur.NewFailureHandler(a.cfg, a.evLogger))
|
||||
|
||||
a.mainService.Add(a.ll)
|
||||
@@ -277,24 +281,21 @@ func (a *App) startup() error {
|
||||
a.mainService.Add(discoveryManager)
|
||||
a.mainService.Add(connectionsService)
|
||||
|
||||
// Candidate builds always run with usage reporting.
|
||||
|
||||
if opts := a.cfg.Options(); build.IsCandidate {
|
||||
l.Infoln("Anonymous usage reporting is always enabled for candidate releases.")
|
||||
if opts.URAccepted != ur.Version {
|
||||
opts.URAccepted = ur.Version
|
||||
a.cfg.SetOptions(opts)
|
||||
a.cfg.Save()
|
||||
// Unique ID will be set and config saved below if necessary.
|
||||
a.cfg.Modify(func(cfg *config.Configuration) {
|
||||
// Candidate builds always run with usage reporting.
|
||||
if build.IsCandidate {
|
||||
l.Infoln("Anonymous usage reporting is always enabled for candidate releases.")
|
||||
if cfg.Options.URAccepted != ur.Version {
|
||||
cfg.Options.URAccepted = ur.Version
|
||||
// Unique ID will be set and config saved below if necessary.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we are going to do usage reporting, ensure we have a valid unique ID.
|
||||
if opts := a.cfg.Options(); opts.URAccepted > 0 && opts.URUniqueID == "" {
|
||||
opts.URUniqueID = rand.String(8)
|
||||
a.cfg.SetOptions(opts)
|
||||
a.cfg.Save()
|
||||
}
|
||||
// If we are going to do usage reporting, ensure we have a valid unique ID.
|
||||
if cfg.Options.URAccepted > 0 && cfg.Options.URUniqueID == "" {
|
||||
cfg.Options.URUniqueID = rand.String(8)
|
||||
}
|
||||
})
|
||||
|
||||
usageReportingSvc := ur.New(a.cfg, m, connectionsService, a.opts.NoUpgrade)
|
||||
a.mainService.Add(usageReportingSvc)
|
||||
|
||||
Reference in New Issue
Block a user