升级时执行一次清理域名统计

This commit is contained in:
刘祥超
2022-02-18 12:58:26 +08:00
parent 7a86ecb44b
commit 4b1a9f9a45

View File

@@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"github.com/TeaOSLab/EdgeAPI/internal/acme" "github.com/TeaOSLab/EdgeAPI/internal/acme"
"github.com/TeaOSLab/EdgeAPI/internal/db/models" "github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/db/models/stats"
"github.com/TeaOSLab/EdgeAPI/internal/errors" "github.com/TeaOSLab/EdgeAPI/internal/errors"
"github.com/TeaOSLab/EdgeAPI/internal/utils" "github.com/TeaOSLab/EdgeAPI/internal/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/dnsconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/dnsconfigs"
@@ -581,5 +582,11 @@ func upgradeV0_4_1(db *dbs.DB) error {
return err return err
} }
// 执行域名统计清理
err = stats.NewServerDomainHourlyStatDAO().Clean(nil, 7)
if err != nil {
return err
}
return nil return nil
} }