mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
Fix tests, bump version (#312)
This commit is contained in:
parent
123c96dde7
commit
9be1a6b1ed
@ -47,7 +47,7 @@ var (
|
|||||||
ProxyMode bool
|
ProxyMode bool
|
||||||
Prefetch bool
|
Prefetch bool
|
||||||
Config = NewWebPConfig()
|
Config = NewWebPConfig()
|
||||||
Version = "0.10.6"
|
Version = "0.10.7"
|
||||||
WriteLock = cache.New(5*time.Minute, 10*time.Minute)
|
WriteLock = cache.New(5*time.Minute, 10*time.Minute)
|
||||||
ConvertLock = cache.New(5*time.Minute, 10*time.Minute)
|
ConvertLock = cache.New(5*time.Minute, 10*time.Minute)
|
||||||
RemoteRaw = "./remote-raw"
|
RemoteRaw = "./remote-raw"
|
||||||
@ -75,7 +75,7 @@ type WebpConfig struct {
|
|||||||
ReadBufferSize int `json:"READ_BUFFER_SIZE"`
|
ReadBufferSize int `json:"READ_BUFFER_SIZE"`
|
||||||
Concurrency int `json:"CONCURRENCY"`
|
Concurrency int `json:"CONCURRENCY"`
|
||||||
DisableKeepalive bool `json:"DISABLE_KEEPALIVE"`
|
DisableKeepalive bool `json:"DISABLE_KEEPALIVE"`
|
||||||
CacheTTL int `json:"CACHE_TTL"`
|
CacheTTL int `json:"CACHE_TTL"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWebPConfig() *WebpConfig {
|
func NewWebPConfig() *WebpConfig {
|
||||||
|
@ -7,11 +7,13 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
"webp_server_go/config"
|
"webp_server_go/config"
|
||||||
"webp_server_go/helper"
|
"webp_server_go/helper"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/gofiber/fiber/v2/middleware/etag"
|
"github.com/gofiber/fiber/v2/middleware/etag"
|
||||||
|
"github.com/patrickmn/go-cache"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -35,6 +37,7 @@ func setupParam() {
|
|||||||
config.Config.EnableAVIF = false
|
config.Config.EnableAVIF = false
|
||||||
config.Config.Quality = 80
|
config.Config.Quality = 80
|
||||||
config.Config.ImageMap = map[string]string{}
|
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) {
|
func requestToServer(reqUrl string, app *fiber.App, ua, accept string) (*http.Response, []byte) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user