Allow route updates even if some domains failed resolution (#2368)

This commit is contained in:
Viktor Liu 2024-08-01 18:38:19 +02:00 committed by GitHub
parent 24e031ab74
commit 57624203c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -189,9 +189,14 @@ func (r *Route) startResolver(ctx context.Context) {
}
func (r *Route) update(ctx context.Context) error {
if resolved, err := r.resolveDomains(); err != nil {
return fmt.Errorf("resolve domains: %w", err)
} else if err := r.updateDynamicRoutes(ctx, resolved); err != nil {
resolved, err := r.resolveDomains()
if err != nil {
if len(resolved) == 0 {
return fmt.Errorf("resolve domains: %w", err)
}
log.Warnf("Failed to resolve domains: %v", err)
}
if err := r.updateDynamicRoutes(ctx, resolved); err != nil {
return fmt.Errorf("update dynamic routes: %w", err)
}