feat: tranfer log to storage
This commit is contained in:
28
modules/setting/build.go
Normal file
28
modules/setting/build.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2022 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package setting
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
)
|
||||
|
||||
// Builds settings
|
||||
var (
|
||||
Builds = struct {
|
||||
Storage
|
||||
Enabled bool
|
||||
}{
|
||||
Enabled: true,
|
||||
}
|
||||
)
|
||||
|
||||
func newBuilds() {
|
||||
sec := Cfg.Section("builds")
|
||||
if err := sec.MapTo(&Builds); err != nil {
|
||||
log.Fatal("Failed to map Builds settings: %v", err)
|
||||
}
|
||||
|
||||
Builds.Storage = getStorage("builds", "", nil)
|
||||
}
|
||||
@@ -1062,6 +1062,8 @@ func loadFromConf(allowEmpty bool, extraConfig string) {
|
||||
|
||||
newPackages()
|
||||
|
||||
newBuilds()
|
||||
|
||||
if err = Cfg.Section("ui").MapTo(&UI); err != nil {
|
||||
log.Fatal("Failed to map UI settings: %v", err)
|
||||
} else if err = Cfg.Section("markdown").MapTo(&Markdown); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user