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
|
@ -7,12 +7,12 @@ package unittest
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
system_model "code.gitea.io/gitea/models/system"
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
@ -91,10 +91,8 @@ func MainTest(m *testing.M, testOpts *TestOptions) {
|
|||
setting.AppDataPath = appDataPath
|
||||
setting.AppWorkPath = testOpts.GiteaRootPath
|
||||
setting.StaticRootPath = testOpts.GiteaRootPath
|
||||
setting.GravatarSourceURL, err = url.Parse("https://secure.gravatar.com/avatar/")
|
||||
if err != nil {
|
||||
fatalTestError("url.Parse: %v\n", err)
|
||||
}
|
||||
setting.GravatarSource = "https://secure.gravatar.com/avatar/"
|
||||
|
||||
setting.Attachment.Storage.Path = filepath.Join(setting.AppDataPath, "attachments")
|
||||
|
||||
setting.LFS.Storage.Path = filepath.Join(setting.AppDataPath, "lfs")
|
||||
|
@ -112,6 +110,9 @@ func MainTest(m *testing.M, testOpts *TestOptions) {
|
|||
if err = storage.Init(); err != nil {
|
||||
fatalTestError("storage.Init: %v\n", err)
|
||||
}
|
||||
if err = system_model.Init(); err != nil {
|
||||
fatalTestError("models.Init: %v\n", err)
|
||||
}
|
||||
|
||||
if err = util.RemoveAll(repoRootPath); err != nil {
|
||||
fatalTestError("util.RemoveAll: %v\n", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue