sync: 同步 v1.0.4 并脱敏配置与镜像

This commit is contained in:
MiFaZhan
2026-10-29 14:36:49 +08:00
parent 743e8e6e6e
commit 2206a393f7
516 changed files with 18119 additions and 2253 deletions
+6 -10
View File
@@ -1,7 +1,7 @@
// Package mcache
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
// 内存缓存管理
package mcache
@@ -16,19 +16,15 @@ import (
// cache 缓存驱动
var (
mcache *gcache.Cache
mu sync.Mutex
mcache *gcache.Cache
cacheOnce sync.Once
)
// Instance 缓存实例
func Instance() *gcache.Cache {
if mcache == nil {
mu.Lock()
if mcache == nil {
mcache = gcache.NewWithAdapter(gcache.NewAdapterMemory())
}
mu.Unlock()
}
cacheOnce.Do(func() {
mcache = gcache.NewWithAdapter(gcache.NewAdapterMemory())
})
return mcache
}