refactor(routes): simplify route exclusion check and health check defaults

This commit is contained in:
yusing
2025-12-04 15:12:35 +08:00
parent f2e73af32f
commit 100eac1f3c
7 changed files with 30 additions and 50 deletions

View File

@@ -224,10 +224,13 @@ func (p *Provider) startRoute(parent task.Parent, r *route.Route) gperr.Error {
p.lockDeleteRoute(r.Alias)
return err.Subject(r.Alias)
}
p.lockAddRoute(r)
r.Task().OnCancel("remove_route_from_provider", func() {
p.lockDeleteRoute(r.Alias)
})
if !r.ShouldExclude() {
r.Task().OnCancel("remove_route_from_provider", func() {
p.lockDeleteRoute(r.Alias)
})
}
return nil
}