diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-11-05 21:10:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-05 13:10:57 +0000 |
commit | 41b4ef825dba14f11b2e9454692b999f92ee1a42 (patch) | |
tree | 19b0358ec1b4be339ecbf023a6f00e702c353e32 /modules/lfs | |
parent | 24b83ff63e7ffd3d412bc9b509102aa2c507ced1 (diff) | |
download | gitea-41b4ef825dba14f11b2e9454692b999f92ee1a42.tar.gz gitea-41b4ef825dba14f11b2e9454692b999f92ee1a42.zip |
Use 8 as default value for git lfs concurrency (#32421)
Diffstat (limited to 'modules/lfs')
-rw-r--r-- | modules/lfs/http_client.go | 3 | ||||
-rw-r--r-- | modules/lfs/http_client_test.go | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/modules/lfs/http_client.go b/modules/lfs/http_client.go index 411c4248c4..3060e25754 100644 --- a/modules/lfs/http_client.go +++ b/modules/lfs/http_client.go @@ -136,6 +136,9 @@ func (c *HTTPClient) performOperation(ctx context.Context, objects []Pointer, dc return fmt.Errorf("TransferAdapter not found: %s", result.Transfer) } + if setting.LFSClient.BatchOperationConcurrency <= 0 { + panic("BatchOperationConcurrency must be greater than 0, forgot to init?") + } errGroup, groupCtx := errgroup.WithContext(ctx) errGroup.SetLimit(setting.LFSClient.BatchOperationConcurrency) for _, object := range result.Objects { diff --git a/modules/lfs/http_client_test.go b/modules/lfs/http_client_test.go index d22735147a..aa7e3c45c4 100644 --- a/modules/lfs/http_client_test.go +++ b/modules/lfs/http_client_test.go @@ -237,7 +237,7 @@ func TestHTTPClientDownload(t *testing.T) { }, } - defer test.MockVariableValue(&setting.LFSClient.BatchOperationConcurrency, 3)() + defer test.MockVariableValue(&setting.LFSClient.BatchOperationConcurrency, 8)() for _, c := range cases { t.Run(c.endpoint, func(t *testing.T) { client := &HTTPClient{ @@ -337,7 +337,7 @@ func TestHTTPClientUpload(t *testing.T) { }, } - defer test.MockVariableValue(&setting.LFSClient.BatchOperationConcurrency, 3)() + defer test.MockVariableValue(&setting.LFSClient.BatchOperationConcurrency, 8)() for _, c := range cases { t.Run(c.endpoint, func(t *testing.T) { client := &HTTPClient{ |