Anonymous: Add device limits to stats (#79494)

* add device limits

* feat: tabs the anon and session stats w. highlight
This commit is contained in:
Eric Leijonmarck
2023-12-18 09:32:57 +01:00
committed by GitHub
parent 86ac431097
commit 57ca8fa368
6 changed files with 74 additions and 22 deletions
+2 -2
View File
@@ -64,8 +64,8 @@ func (hs *HTTPServer) AdminGetStats(c *contextmodel.ReqContext) response.Respons
if err != nil {
return response.Error(500, "Failed to get admin stats from database", err)
}
thirtyDays := 30 * 24 * time.Hour
devicesCount, err := hs.anonService.CountDevices(c.Req.Context(), time.Now().Add(-thirtyDays), time.Now().Add(time.Minute))
anonymousDeviceExpiration := 30 * 24 * time.Hour
devicesCount, err := hs.anonService.CountDevices(c.Req.Context(), time.Now().Add(-anonymousDeviceExpiration), time.Now().Add(time.Minute))
if err != nil {
return response.Error(500, "Failed to get anon stats from database", err)
}