forked from forgejo/forgejo
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:
parent
67561e79f1
commit
960c322586
6 changed files with 48 additions and 61 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue