Skip to content

Commit 1d5ee04

Browse files
清理无关配置
1 parent b2c8af4 commit 1d5ee04

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

cmd/server/config.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ type Config struct {
2121
Bind string `yaml:"bind"` // HTTP 绑定
2222
Domain string `yaml:"domain"` // 基础域名
2323

24+
// todo: 拆分 alias 和 db
2425
Database ConfigDatabase `yaml:"database"` // 配置
25-
Event ConfigEvent `yaml:"event"` // 事件传递
26+
27+
Event ConfigEvent `yaml:"event"` // 事件传递
2628

2729
Auth ConfigAuth `yaml:"auth"` // 后端认证配置
2830

@@ -81,14 +83,6 @@ type ConfigEvent struct {
8183
URL string `yaml:"url"`
8284
}
8385

84-
type ConfigProxy struct {
85-
Enable bool `yaml:"enable"` // 是否允许反向代理
86-
}
87-
88-
type ConfigRender struct {
89-
Enable bool `yaml:"enable"` // 是否开启渲染器
90-
}
91-
9286
type ConfigCache struct {
9387
Meta string `yaml:"meta"` // 元数据缓存
9488
MetaTTL time.Duration `yaml:"meta_ttl"` // 缓存时间

pkg/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ func NewPageServer(
5555
filterConfig map[string]map[string]any,
5656
) (*Server, error) {
5757
svcMeta := core.NewServerMeta(client, backend, domain, cacheMeta, cacheMetaTTL)
58-
pageMeta := core.NewPageDomain(svcMeta, core.NewDomainAlias(db.Child("config").Child("alias")), domain, defaultBranch)
59-
globCache, err := lru.New[string, glob.Glob](256)
58+
pageMeta := core.NewPageDomain(svcMeta, core.NewDomainAlias(db.Child("config", "alias")), domain, defaultBranch)
59+
globCache, err := lru.New[string, glob.Glob](512)
6060
if err != nil {
6161
return nil, err
6262
}

0 commit comments

Comments
 (0)