增加单元测试,统一初始化方法

This commit is contained in:
ayflying
2025-04-02 15:19:49 +08:00
parent 1d0661ae40
commit 743d232c38
10 changed files with 133 additions and 46 deletions

View File

@@ -1,14 +1,11 @@
package aycache
import (
v1 "github.com/ayflying/utility_go/api/system/v1"
"github.com/ayflying/utility_go/pkg/aycache/drive"
drive2 "github.com/ayflying/utility_go/pkg/aycache/drive"
"github.com/ayflying/utility_go/service"
"github.com/gogf/gf/v2/os/gcache"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"math"
)
type Mod struct {
@@ -25,16 +22,6 @@ var (
)
)
func init() {
service.SystemCron().AddCron(v1.CronType_MINUTE, func() error {
QPS.Set(math.Round(float64(QPSCount) / 60))
QPSCount = 0
return nil
})
}
func New(_name ...string) gcache.Adapter {
var cacheAdapterObj gcache.Adapter