mirror of
https://github.com/komari-monitor/komari.git
synced 2026-11-24 17:10:54 +00:00
feat: 使用go-cache替代安全映射
ci: main自动发布附件
This commit is contained in:
1 parent
8da28d6b95
commit
215fdc822c
6 files changed
+147
-48
No files matched your search
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/komari-monitor/komari/database/tasks"
|
||||
"github.com/komari-monitor/komari/utils/notification"
|
||||
"github.com/komari-monitor/komari/ws"
|
||||
"github.com/patrickmn/go-cache"
|
||||
)
|
||||
|
||||
func UploadReport(c *gin.Context) {
|
||||
@@ -185,8 +186,8 @@ func SaveClientReport(uuid string, report common.Report) error {
|
||||
if report.CPU.Usage < 0.01 {
|
||||
report.CPU.Usage = 0.01
|
||||
}
|
||||
reports = append(reports, report)
|
||||
api.Records.Set(uuid, reports)
|
||||
reports = append(reports.([]common.Report), report)
|
||||
api.Records.Set(uuid, reports, cache.DefaultExpiration)
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user