mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 03:24:11 +00:00
Log any database errors when fetching stats
Previously, these errors were simply ignored
This commit is contained in:
parent
baf1d76475
commit
2b5318e7a6
1 changed files with 6 additions and 0 deletions
|
@ -94,6 +94,9 @@ INNER JOIN collections c
|
|||
ON collection_id = c.id
|
||||
WHERE collection_id IS NOT NULL
|
||||
AND updated > DATE_SUB(NOW(), INTERVAL 6 MONTH)) co`).Scan(&activeHalfYear)
|
||||
if err != nil {
|
||||
log.Error("Failed getting 6-month active user stats: %s", err)
|
||||
}
|
||||
|
||||
err = r.db.QueryRow(`SELECT COUNT(*) FROM (
|
||||
SELECT DISTINCT collection_id
|
||||
|
@ -102,6 +105,9 @@ INNER JOIN collections c
|
|||
ON collection_id = c.id
|
||||
WHERE collection_id IS NOT NULL
|
||||
AND updated > DATE_SUB(NOW(), INTERVAL 1 MONTH)) co`).Scan(&activeMonth)
|
||||
if err != nil {
|
||||
log.Error("Failed getting 1-month active user stats: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nodeinfo.Usage{
|
||||
|
|
Loading…
Reference in a new issue