优化结构

This commit is contained in:
Yvan
2026-08-30 01:08:10 +08:00
parent 509df03d61
commit e0c35e4e9b
23 changed files with 1513 additions and 38 deletions
+10 -1
View File
@@ -279,7 +279,13 @@ func configStrings(values map[string]any, key string) []string {
}
stringsValue, ok := values[key].([]string)
if ok {
return append([]string(nil), stringsValue...)
result := make([]string, 0, len(stringsValue))
for _, item := range stringsValue {
if value := strings.TrimSpace(item); value != "" {
result = append(result, value)
}
}
return result
}
return nil
}
@@ -327,6 +333,9 @@ func (r *Reloadable) retryOnce() {
client := r.clientLocked(provider)
if client != nil && client.Connected() {
if r.pending[provider] {
if retryAt := r.nextRetry[provider]; !retryAt.IsZero() && now.Before(retryAt) {
continue
}
if err := r.reconcileProviderLocked(provider); err != nil {
r.scheduleRetryLocked(provider, config.Values)
}