remove unused bufferpool

This commit is contained in:
wjqserver 2025-04-17 22:30:00 +08:00
parent dd2f5b5a12
commit c1c39a5a1f

View file

@ -4,7 +4,6 @@ import (
"fmt"
"ghproxy/config"
"net/http"
"sync"
"time"
httpc "github.com/satomitouka/touka-httpc"
@ -13,11 +12,10 @@ import (
var BufferSize int = 32 * 1024 // 32KB
var (
tr *http.Transport
gittr *http.Transport
BufferPool *sync.Pool
client *httpc.Client
gitclient *httpc.Client
tr *http.Transport
gittr *http.Transport
client *httpc.Client
gitclient *httpc.Client
)
func InitReq(cfg *config.Config) {
@ -25,13 +23,6 @@ func InitReq(cfg *config.Config) {
if cfg.GitClone.Mode == "cache" {
initGitHTTPClient(cfg)
}
// 初始化固定大小的缓存池
BufferPool = &sync.Pool{
New: func() interface{} {
return make([]byte, BufferSize)
},
}
}
func initHTTPClient(cfg *config.Config) {