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
|
@ -11,6 +11,7 @@ import (
|
|||
"code.gitea.io/gitea/models"
|
||||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/updatechecker"
|
||||
)
|
||||
|
||||
func registerDeleteInactiveUsers() {
|
||||
|
@ -145,7 +146,7 @@ func registerUpdateGiteaChecker() {
|
|||
HTTPEndpoint: "https://dl.gitea.io/gitea/version.json",
|
||||
}, func(ctx context.Context, _ *models.User, config Config) error {
|
||||
updateCheckerConfig := config.(*UpdateCheckerConfig)
|
||||
return models.GiteaUpdateChecker(updateCheckerConfig.HTTPEndpoint)
|
||||
return updatechecker.GiteaUpdateChecker(updateCheckerConfig.HTTPEndpoint)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue