File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -324,6 +324,9 @@ RUN_USER = ; git
324
324
; ; Maximum number of locks returned per page
325
325
; LFS_LOCKS_PAGING_NUM = 50
326
326
; ;
327
+ ; ; Maximum number of concurrent LFS object upload/downloads and count to request per batch request
328
+ ; LFS_BATCH_SIZE = 20
329
+ ; ;
327
330
; ; Allow graceful restarts using SIGHUP to fork
328
331
; ALLOW_GRACEFUL_RESTARTS = true
329
332
; ;
Original file line number Diff line number Diff line change @@ -16,10 +16,9 @@ import (
16
16
"code.gitea.io/gitea/modules/json"
17
17
"code.gitea.io/gitea/modules/log"
18
18
"code.gitea.io/gitea/modules/proxy"
19
+ "code.gitea.io/gitea/modules/setting"
19
20
)
20
21
21
- const httpBatchSize = 20
22
-
23
22
// HTTPClient is used to communicate with the LFS server
24
23
// https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md
25
24
type HTTPClient struct {
@@ -30,7 +29,7 @@ type HTTPClient struct {
30
29
31
30
// BatchSize returns the preferred size of batchs to process
32
31
func (c * HTTPClient ) BatchSize () int {
33
- return httpBatchSize
32
+ return setting . LFS . BatchSize
34
33
}
35
34
36
35
func newHTTPClient (endpoint * url.URL , httpTransport * http.Transport ) * HTTPClient {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ var LFS = struct {
18
18
HTTPAuthExpiry time.Duration `ini:"LFS_HTTP_AUTH_EXPIRY"`
19
19
MaxFileSize int64 `ini:"LFS_MAX_FILE_SIZE"`
20
20
LocksPagingNum int `ini:"LFS_LOCKS_PAGING_NUM"`
21
+ BatchSize int `ini:"LFS_BATCH_SIZE"`
21
22
22
23
Storage * Storage
23
24
}{}
@@ -53,6 +54,10 @@ func loadLFSFrom(rootCfg ConfigProvider) error {
53
54
LFS .LocksPagingNum = 50
54
55
}
55
56
57
+ if LFS .BatchSize < 1 {
58
+ LFS .BatchSize = 20
59
+ }
60
+
56
61
LFS .HTTPAuthExpiry = sec .Key ("LFS_HTTP_AUTH_EXPIRY" ).MustDuration (24 * time .Hour )
57
62
58
63
if ! LFS .StartServer || ! InstallLock {
You can’t perform that action at this time.
0 commit comments