mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-08 00:26:37 +08:00
[优化] 优化对主配置路径的存在性检查以增强健康检查逻辑
This commit is contained in:
@@ -268,6 +268,9 @@ func (r *Runner) refreshOpenrestyHealth(ctx context.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := r.RuntimeManager.CheckHealth(ctx); err != nil {
|
if err := r.RuntimeManager.CheckHealth(ctx); err != nil {
|
||||||
|
if strings.Contains(err.Error(), "openresty config not exists") {
|
||||||
|
return
|
||||||
|
}
|
||||||
r.recordOpenrestyUnhealthy(err, true)
|
r.recordOpenrestyUnhealthy(err, true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,6 +260,11 @@ func (m *Manager) CheckHealth(ctx context.Context) error {
|
|||||||
if m.Executor == nil {
|
if m.Executor == nil {
|
||||||
return errors.New("executor 未配置")
|
return errors.New("executor 未配置")
|
||||||
}
|
}
|
||||||
|
if m.MainConfigPath != "" {
|
||||||
|
if _, err := os.Stat(m.MainConfigPath); os.IsNotExist(err) {
|
||||||
|
return errors.New("openresty config not exists: waiting for initial sync")
|
||||||
|
}
|
||||||
|
}
|
||||||
return m.Executor.CheckHealth(ctx)
|
return m.Executor.CheckHealth(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user