From 9be1a6b1edefafde12e934d60128fcc8b99e8f38 Mon Sep 17 00:00:00 2001 From: Nova Kwok Date: Sun, 11 Feb 2024 12:04:19 +0800 Subject: [PATCH] Fix tests, bump version (#312) --- config/config.go | 4 ++-- handler/router_test.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 5d45c82..8ca9239 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 cd1cf73..6e1253d 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) {