mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add system setting table with cache and also add cache supports for user setting (#18058)
This commit is contained in:
@@ -8,10 +8,10 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"code.gitea.io/gitea/modules/appstate"
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/proxy"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/system"
|
||||
|
||||
"github.com/hashicorp/go-version"
|
||||
)
|
||||
@@ -64,13 +64,13 @@ func GiteaUpdateChecker(httpEndpoint string) error {
|
||||
|
||||
// UpdateRemoteVersion updates the latest available version of Gitea
|
||||
func UpdateRemoteVersion(version string) (err error) {
|
||||
return appstate.AppState.Set(&CheckerState{LatestVersion: version})
|
||||
return system.AppState.Set(&CheckerState{LatestVersion: version})
|
||||
}
|
||||
|
||||
// GetRemoteVersion returns the current remote version (or currently installed version if fail to fetch from DB)
|
||||
func GetRemoteVersion() string {
|
||||
item := new(CheckerState)
|
||||
if err := appstate.AppState.Get(item); err != nil {
|
||||
if err := system.AppState.Get(item); err != nil {
|
||||
return ""
|
||||
}
|
||||
return item.LatestVersion
|
||||
|
Reference in New Issue
Block a user