Fix tests, bump version (#312)

This commit is contained in:
Nova Kwok 2024-02-11 12:04:19 +08:00 committed by GitHub
parent 123c96dde7
commit 9be1a6b1ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -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 {

View File

@ -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) {