mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Refactor update checker to use AppState (#17387)
We have the `AppState` module now, it can store app related data easily. We do not need to create separate tables for each feature. So the update checker can use `AppState` instead of a one-row dedicate table. And the code of update checker is moved from `models` to `modules`.
This commit is contained in:
		@@ -26,6 +26,7 @@ import (
 | 
			
		||||
	"code.gitea.io/gitea/modules/queue"
 | 
			
		||||
	"code.gitea.io/gitea/modules/setting"
 | 
			
		||||
	"code.gitea.io/gitea/modules/timeutil"
 | 
			
		||||
	"code.gitea.io/gitea/modules/updatechecker"
 | 
			
		||||
	"code.gitea.io/gitea/modules/web"
 | 
			
		||||
	"code.gitea.io/gitea/services/forms"
 | 
			
		||||
	"code.gitea.io/gitea/services/mailer"
 | 
			
		||||
@@ -125,8 +126,8 @@ func Dashboard(ctx *context.Context) {
 | 
			
		||||
	ctx.Data["PageIsAdmin"] = true
 | 
			
		||||
	ctx.Data["PageIsAdminDashboard"] = true
 | 
			
		||||
	ctx.Data["Stats"] = models.GetStatistic()
 | 
			
		||||
	ctx.Data["NeedUpdate"] = models.GetNeedUpdate()
 | 
			
		||||
	ctx.Data["RemoteVersion"] = models.GetRemoteVersion()
 | 
			
		||||
	ctx.Data["NeedUpdate"] = updatechecker.GetNeedUpdate()
 | 
			
		||||
	ctx.Data["RemoteVersion"] = updatechecker.GetRemoteVersion()
 | 
			
		||||
	// FIXME: update periodically
 | 
			
		||||
	updateSystemStatus()
 | 
			
		||||
	ctx.Data["SysStatus"] = sysStatus
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user