first commit

This commit is contained in:
Vaala Cat
2024-02-02 23:21:43 +08:00
commit 0b86be3426
52 changed files with 4390 additions and 0 deletions

18
service/cache.go Normal file
View File

@@ -0,0 +1,18 @@
package service
import (
"github.com/coocood/freecache"
)
var (
searchCache *freecache.Cache
)
func InitCache() {
cacheSize := GetSettings().CacheSize * 1024 * 1024 // 100 MB
searchCache = freecache.NewCache(cacheSize)
}
func GetSearchCache() *freecache.Cache {
return searchCache
}