Switch to minutes for uptime, remove duplicate event on startup

This commit is contained in:
Matthew Kilgore
2025-07-12 20:42:12 -04:00
parent 57385f9ada
commit e47a7ff6f2
2 changed files with 2 additions and 10 deletions

View File

@@ -98,14 +98,6 @@ func run(cfg *config.Config) error {
app := new(cfg)
app.setupLogger()
// Send analytics if enabled on startup
if cfg.Options.AllowAnalytics {
err := analytics.Send(version, build())
if err != nil {
log.Error().Err(err).Msg("failed to send analytics")
}
}
// =========================================================================
// Initialize Database & Repos
setupStorageDir(cfg)

View File

@@ -34,7 +34,7 @@ func Send(version, buildInfo string) error {
"platform_version": hostData.PlatformVersion,
"kernel_arch": hostData.KernelArch,
"virt_type": hostData.VirtualizationSystem,
"uptime_sec": time.Since(startTime).Seconds(),
"uptime_min": time.Since(startTime).Minutes(),
},
}
jsonBody, err := json.Marshal(analytics)
@@ -50,7 +50,7 @@ func Send(version, buildInfo string) error {
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("User-Agent", "Homebox/"+version+"/"+buildInfo+" (https://homebox.software)")
req.Header.Set("User-Agent", "Homebox/"+version+"/(https://homebox.software)")
client := &http.Client{
Timeout: 10 * time.Second,