优化结构
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user