feat 单元测试

This commit is contained in:
2026-01-05 00:32:24 +08:00
parent 3ea3a3ac6d
commit 6523820cf6
5 changed files with 229 additions and 4 deletions

View File

@@ -24,8 +24,10 @@ func Init(cfg *config.RedisConfig) error {
cli: client,
}
cacheInstance = &CacheClient{
cli: client,
logger: log.GetLogger().Named("CACHE"),
cli: client,
}
if logger := log.GetLogger(); logger != nil {
cacheInstance.logger = logger.Named("CACHE")
}
_, err := client.Ping(context.Background()).Result()