aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2021-10-22 00:10:49 +0800
committerGitHub <noreply@github.com>2021-10-21 17:10:49 +0100
commit960c322586eceb9598bb0a9985a8dd987dc74807 (patch)
tree8a95695e81f571c82728994a006620b08e7fc8ab /routers/web
parent67561e79f15f23a00ad07df36de0ee54d69efc78 (diff)
downloadgitea-960c322586eceb9598bb0a9985a8dd987dc74807.tar.gz
gitea-960c322586eceb9598bb0a9985a8dd987dc74807.zip
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`.
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/admin/admin.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/web/admin/admin.go b/routers/web/admin/admin.go
index ca5b157523..223114dae1 100644
--- a/routers/web/admin/admin.go
+++ b/routers/web/admin/admin.go
@@ -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