mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	Implement archive cleanup (#885)
* Implement archive cleanup Fixes #769 Signed-off-by: Andrew <write@imaginarycode.com> * Make sure to close the directory file * Resolve issues noted by @strk * edit cheatsheet app.ini [ci skip] * oops [ci skip]
This commit is contained in:
		@@ -55,6 +55,17 @@ func NewContext() {
 | 
			
		||||
			go models.CheckRepoStats()
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if setting.Cron.ArchiveCleanup.Enabled {
 | 
			
		||||
		entry, err = c.AddFunc("Clean up old repository archives", setting.Cron.ArchiveCleanup.Schedule, models.DeleteOldRepositoryArchives)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			log.Fatal(4, "Cron[Clean up old repository archives]: %v", err)
 | 
			
		||||
		}
 | 
			
		||||
		if setting.Cron.ArchiveCleanup.RunAtStart {
 | 
			
		||||
			entry.Prev = time.Now()
 | 
			
		||||
			entry.ExecTimes++
 | 
			
		||||
			go models.DeleteOldRepositoryArchives()
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	c.Start()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user