mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-27 18:11:57 +08:00
Feat: get file source route / Fix: cache initialize at wrong time
This commit is contained in:
3
pkg/cache/driver.go
vendored
3
pkg/cache/driver.go
vendored
@@ -8,7 +8,8 @@ import (
|
||||
// Store 缓存存储器
|
||||
var Store Driver
|
||||
|
||||
func init() {
|
||||
// Init 初始化缓存
|
||||
func Init() {
|
||||
//Store = NewRedisStore(10, "tcp", "127.0.0.1:6379", "", "0")
|
||||
//return
|
||||
if conf.RedisConfig.Server == "" || gin.Mode() == gin.TestMode {
|
||||
|
||||
8
pkg/cache/driver_test.go
vendored
8
pkg/cache/driver_test.go
vendored
@@ -42,3 +42,11 @@ func TestSetSettings(t *testing.T) {
|
||||
asserts.Equal("3", value1)
|
||||
asserts.Equal("4", value2)
|
||||
}
|
||||
|
||||
func TestInit(t *testing.T) {
|
||||
asserts := assert.New(t)
|
||||
|
||||
asserts.NotPanics(func() {
|
||||
Init()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user