Code cosmetics

This commit is contained in:
Andrei Pohilko
2022-12-06 15:31:18 +00:00
parent 2c1883c835
commit 2c25193adf
7 changed files with 31 additions and 9 deletions

View File

@@ -29,6 +29,11 @@ func (s Server) StartServer() (string, utils.ControlChan) {
data := subproc.DataLayer{
Namespace: s.Namespace,
Cache: subproc.NewCache(),
StatusInfo: &subproc.StatusInfo{
CurVer: s.Version,
Analytics: false,
LimitedToNamespace: s.Namespace,
},
}
err := data.CheckConnectivity()
if err != nil {
@@ -36,12 +41,7 @@ func (s Server) StartServer() (string, utils.ControlChan) {
os.Exit(1) // TODO: propagate error instead?
}
isDevModeWithAnalytics := os.Getenv("HD_DEV_ANALYTICS") == "true"
enableAnalytics := (!s.NoTracking && s.Version != "0.0.0") || isDevModeWithAnalytics
data.StatusInfo = &subproc.StatusInfo{
CurVer: s.Version,
Analytics: enableAnalytics,
LimitedToNamespace: s.Namespace,
}
data.StatusInfo.Analytics = (!s.NoTracking && s.Version != "0.0.0") || isDevModeWithAnalytics
go checkUpgrade(data.StatusInfo)
discoverScanners(&data)