From c5685b4ea17b983aa4d258376d5b58b4588f19fe Mon Sep 17 00:00:00 2001 From: pat-s Date: Wed, 25 Jun 2025 23:13:05 +0200 Subject: [PATCH] more tests --- modules/httplib/client_pool.go | 4 ++-- services/f3/driver/options.go | 6 +----- services/migrations/onedev.go | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/httplib/client_pool.go b/modules/httplib/client_pool.go index 904014c6bf..4e9e7bc1e5 100644 --- a/modules/httplib/client_pool.go +++ b/modules/httplib/client_pool.go @@ -52,13 +52,13 @@ func (cp *ClientPool) GetClient(key string) *http.Client { return client } - client := cp.createClient(key) + client := cp.createClient() cp.clients[key] = client return client } // createClient creates a new HTTP client with optimized connection pooling -func (cp *ClientPool) createClient(key string) *http.Client { +func (cp *ClientPool) createClient() *http.Client { transport := &http.Transport{ Proxy: proxy.Proxy(), DialContext: (&net.Dialer{ diff --git a/services/f3/driver/options.go b/services/f3/driver/options.go index d983ad6c00..df82601874 100644 --- a/services/f3/driver/options.go +++ b/services/f3/driver/options.go @@ -5,8 +5,6 @@ package driver import ( - "net/http" - "forgejo.org/modules/httplib" driver_options "forgejo.org/services/f3/driver/options" @@ -16,8 +14,6 @@ import ( func newOptions() options.Interface { o := &driver_options.Options{} o.SetName(driver_options.Name) - o.SetNewMigrationHTTPClient(func() *http.Client { - return httplib.GetMigrationClient() - }) + o.SetNewMigrationHTTPClient(httplib.GetMigrationClient) return o } diff --git a/services/migrations/onedev.go b/services/migrations/onedev.go index 7522b2c758..a4d44fb2bc 100644 --- a/services/migrations/onedev.go +++ b/services/migrations/onedev.go @@ -5,7 +5,6 @@ package migrations import ( "context" - "encoding/json" "fmt" "net/http" "net/url" @@ -14,6 +13,7 @@ import ( "time" "forgejo.org/modules/httplib" + "forgejo.org/modules/json" "forgejo.org/modules/log" base "forgejo.org/modules/migration" "forgejo.org/modules/structs"