@@ -171,34 +171,35 @@ func registerDeleteOldSystemNotices() {
171171	})
172172}
173173
174+ type  GCLFSConfig  struct  {
175+ 	BaseConfig 
176+ 	OlderThan                 time.Duration 
177+ 	LastUpdatedMoreThanAgo    time.Duration 
178+ 	NumberToCheckPerRepo      int64 
179+ 	ProportionToCheckPerRepo  float64 
180+ }
181+ 
174182func  registerGCLFS () {
175183	if  ! setting .LFS .StartServer  {
176184		return 
177185	}
178- 	type  GCLFSConfig  struct  {
179- 		OlderThanConfig 
180- 		LastUpdatedMoreThanAgo    time.Duration 
181- 		NumberToCheckPerRepo      int64 
182- 		ProportionToCheckPerRepo  float64 
183- 	}
184186
185187	RegisterTaskFatal ("gc_lfs" , & GCLFSConfig {
186- 		OlderThanConfig : OlderThanConfig {
187- 			BaseConfig : BaseConfig {
188- 				Enabled :    false ,
189- 				RunAtStart : false ,
190- 				Schedule :   "@every 24h" ,
191- 			},
192- 			// Only attempt to garbage collect lfs meta objects older than a week as the order of git lfs upload 
193- 			// and git object upload is not necessarily guaranteed. It's possible to imagine a situation whereby 
194- 			// an LFS object is uploaded but the git branch is not uploaded immediately, or there are some rapid 
195- 			// changes in new branches that might lead to lfs objects becoming temporarily unassociated with git 
196- 			// objects. 
197- 			// 
198- 			// It is likely that a week is potentially excessive but it should definitely be enough that any 
199- 			// unassociated LFS object is genuinely unassociated. 
200- 			OlderThan : 24  *  time .Hour  *  7 ,
188+ 		BaseConfig : BaseConfig {
189+ 			Enabled :    false ,
190+ 			RunAtStart : false ,
191+ 			Schedule :   "@every 24h" ,
201192		},
193+ 		// Only attempt to garbage collect lfs meta objects older than a week as the order of git lfs upload 
194+ 		// and git object upload is not necessarily guaranteed. It's possible to imagine a situation whereby 
195+ 		// an LFS object is uploaded but the git branch is not uploaded immediately, or there are some rapid 
196+ 		// changes in new branches that might lead to lfs objects becoming temporarily unassociated with git 
197+ 		// objects. 
198+ 		// 
199+ 		// It is likely that a week is potentially excessive but it should definitely be enough that any 
200+ 		// unassociated LFS object is genuinely unassociated. 
201+ 		OlderThan : 24  *  time .Hour  *  7 ,
202+ 
202203		// Only GC things that haven't been looked at in the past 3 days 
203204		LastUpdatedMoreThanAgo :   24  *  time .Hour  *  3 ,
204205		NumberToCheckPerRepo :     100 ,
0 commit comments