瀏覽代碼

Log any database errors when fetching stats

Previously, these errors were simply ignored
pull/769/head
Matt Baer 7 月之前
父節點
當前提交
2b5318e7a6
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. +6
    -0
      nodeinfo.go

+ 6
- 0
nodeinfo.go 查看文件

@@ -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…
取消
儲存