优化操作系统和浏览器统计相关程序

This commit is contained in:
GoEdgeLab
2022-11-11 17:48:30 +08:00
parent b02ca0c840
commit 1a1b937a63
24 changed files with 1055 additions and 127 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
"github.com/iwind/TeaGo/dbs"
"github.com/iwind/TeaGo/types"
timeutil "github.com/iwind/TeaGo/utils/time"
"regexp"
)
@@ -178,7 +179,7 @@ func upgradeV0_5_6(db *dbs.DB) error {
}
// v0.5.7
func upgradeV0_5_7(db *dbs.DB) error {
func upgradeV0_5_8(db *dbs.DB) error {
// node task versions
{
_, err := db.Exec("UPDATE edgeNodeTasks SET version=0 WHERE LENGTH(version)=19")
@@ -187,5 +188,20 @@ func upgradeV0_5_7(db *dbs.DB) error {
}
}
// 删除操作系统和浏览器相关统计
// 只删除当前月,避免因为数据过多阻塞
{
_, err := db.Exec("DELETE FROM edgeServerClientSystemMonthlyStats WHERE month=?", timeutil.Format("Ym"))
if err != nil {
return err
}
}
{
_, err := db.Exec("DELETE FROM edgeServerClientBrowserMonthlyStats WHERE month=?", timeutil.Format("Ym"))
if err != nil {
return err
}
}
return nil
}