feat: add retention policy and stability verification

This commit is contained in:
2026-09-22 16:19:21 +08:00
parent c33c12c5e9
commit 2f95d9c45c
30 changed files with 1633 additions and 18 deletions

View File

@@ -7,9 +7,12 @@ import (
"os"
"strconv"
"time"
"git.yuntuo.hk/k2safe/orbit/internal/retention"
)
type Config struct {
RetentionDefaults retention.Policy // RetentionDefaults 未保存数据库策略时使用的部署默认值。
HTTPAddr string
MySQLDSN string
MaxOpen int
@@ -120,5 +123,10 @@ func FromEnv(get func(string) string) (Config, error) {
return Config{}, errors.New("invalid ORBIT_METRICS_ADDR")
}
}
var err error
c.RetentionDefaults, err = retention.FromEnv(get)
if err != nil {
return Config{}, err
}
return c, nil
}