1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Use 8 as default value for git lfs concurrency (#32421)

This commit is contained in:
wxiaoguang
2024-11-05 21:10:57 +08:00
committed by GitHub
parent 24b83ff63e
commit 41b4ef825d
5 changed files with 9 additions and 6 deletions

View File

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

View File

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