feat: complete daemon operations and recovery tooling
This commit is contained in:
@@ -101,6 +101,9 @@ type Backend struct {
|
||||
ActiveJAR string `toml:"active_jar"`
|
||||
// SystemctlPath systemctl 可执行文件的绝对路径。
|
||||
SystemctlPath string `toml:"systemctl_path"`
|
||||
// StopGraceSeconds 容器后端停止旧容器时,发送停止信号后到强制终止前的等待秒数。
|
||||
// 可省略;省略时执行器使用默认值 30。原生后端不使用该字段。
|
||||
StopGraceSeconds *int `toml:"stop_grace_seconds"`
|
||||
// Slot 包含 8080、8081 两个受支持槽位的精确取值。
|
||||
Slot BackendSlots `toml:"slot"`
|
||||
}
|
||||
@@ -187,7 +190,7 @@ func validateExactDocumentKeys(document []byte) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := rejectUnknownKeys(backend, "backend", "type", "release_dir", "active_jar", "systemctl_path", "slot"); err != nil {
|
||||
if err := rejectUnknownKeys(backend, "backend", "type", "release_dir", "active_jar", "systemctl_path", "stop_grace_seconds", "slot"); err != nil {
|
||||
return err
|
||||
}
|
||||
slots, err := exactTable(backend, "backend", "slot")
|
||||
@@ -264,6 +267,9 @@ func (c Config) Validate() error {
|
||||
if err := validateAbsolutePath("backend.systemctl_path", c.Backend.SystemctlPath); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.Backend.StopGraceSeconds != nil && *c.Backend.StopGraceSeconds <= 0 {
|
||||
return errors.New("backend.stop_grace_seconds must be a positive integer")
|
||||
}
|
||||
switch c.Backend.Type {
|
||||
case BackendTypeNative:
|
||||
if c.Backend.Slot.Port8080.ContainerName != "" || c.Backend.Slot.Port8081.ContainerName != "" {
|
||||
|
||||
Reference in New Issue
Block a user