forked from forgejo/forgejo
Add system setting table with cache and also add cache supports for user setting (#18058)
This commit is contained in:
parent
5d3dbffa15
commit
f860a6d2e4
59 changed files with 1117 additions and 436 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue