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
324324; ; Maximum number of locks returned per page
325325; LFS_LOCKS_PAGING_NUM = 50
326326; ;
327+ ; ; Maximum number of concurrent LFS object upload/downloads and count to request per batch request
328+ ; LFS_BATCH_SIZE = 20
329+ ; ;
327330; ; Allow graceful restarts using SIGHUP to fork
328331; ALLOW_GRACEFUL_RESTARTS = true
329332; ;
Original file line number Diff line number Diff line change @@ -16,10 +16,9 @@ import (
1616	"code.gitea.io/gitea/modules/json" 
1717	"code.gitea.io/gitea/modules/log" 
1818	"code.gitea.io/gitea/modules/proxy" 
19+ 	"code.gitea.io/gitea/modules/setting" 
1920)
2021
21- const  httpBatchSize  =  20 
22- 
2322// HTTPClient is used to communicate with the LFS server 
2423// https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md 
2524type  HTTPClient  struct  {
@@ -30,7 +29,7 @@ type HTTPClient struct {
3029
3130// BatchSize returns the preferred size of batchs to process 
3231func  (c  * HTTPClient ) BatchSize () int  {
33- 	return  httpBatchSize 
32+ 	return  setting . LFS . BatchSize 
3433}
3534
3635func  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 {
1818	HTTPAuthExpiry  time.Duration  `ini:"LFS_HTTP_AUTH_EXPIRY"` 
1919	MaxFileSize     int64          `ini:"LFS_MAX_FILE_SIZE"` 
2020	LocksPagingNum  int            `ini:"LFS_LOCKS_PAGING_NUM"` 
21+ 	BatchSize       int            `ini:"LFS_BATCH_SIZE"` 
2122
2223	Storage  * Storage 
2324}{}
@@ -53,6 +54,10 @@ func loadLFSFrom(rootCfg ConfigProvider) error {
5354		LFS .LocksPagingNum  =  50 
5455	}
5556
57+ 	if  LFS .BatchSize  <  1  {
58+ 		LFS .BatchSize  =  20 
59+ 	}
60+ 
5661	LFS .HTTPAuthExpiry  =  sec .Key ("LFS_HTTP_AUTH_EXPIRY" ).MustDuration (24  *  time .Hour )
5762
5863	if  ! LFS .StartServer  ||  ! InstallLock  {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments