diff --git a/config/config.go b/config/config.go index 5d45c82c8..8ca923901 100644 --- a/config/config.go +++ b/config/config.go @@ -47,7 +47,7 @@ var ( ProxyMode bool Prefetch bool Config = NewWebPConfig() - Version = "0.10.6" + Version = "0.10.7" WriteLock = cache.New(5*time.Minute, 10*time.Minute) ConvertLock = cache.New(5*time.Minute, 10*time.Minute) RemoteRaw = "./remote-raw" @@ -75,7 +75,7 @@ type WebpConfig struct { ReadBufferSize int `json:"READ_BUFFER_SIZE"` Concurrency int `json:"CONCURRENCY"` DisableKeepalive bool `json:"DISABLE_KEEPALIVE"` - CacheTTL int `json:"CACHE_TTL"` + CacheTTL int `json:"CACHE_TTL"` } func NewWebPConfig() *WebpConfig { diff --git a/handler/router_test.go b/handler/router_test.go index cd1cf73b8..6e1253d40 100644 --- a/handler/router_test.go +++ b/handler/router_test.go @@ -7,11 +7,13 @@ import ( "net/url" "os" "testing" + "time" "webp_server_go/config" "webp_server_go/helper" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/etag" + "github.com/patrickmn/go-cache" "github.com/stretchr/testify/assert" ) @@ -35,6 +37,7 @@ func setupParam() { config.Config.EnableAVIF = false config.Config.Quality = 80 config.Config.ImageMap = map[string]string{} + config.RemoteCache = cache.New(cache.NoExpiration, 10*time.Minute) } func requestToServer(reqUrl string, app *fiber.App, ua, accept string) (*http.Response, []byte) {