summaryrefslogtreecommitdiffstats
path: root/modules/cron
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 /modules/cron
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 'modules/cron')
-rw-r--r--modules/cron/tasks_extended.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/cron/tasks_extended.go b/modules/cron/tasks_extended.go
index 6645e71d2c..9a37c40faf 100644
--- a/modules/cron/tasks_extended.go
+++ b/modules/cron/tasks_extended.go
@@ -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)
})
}