Chore (sqlstore): add validation and testing for repl config (#90683)
* add some validation and testing for repl cf * connection strings are secrets
This commit is contained in:
@@ -2,6 +2,7 @@ package sqlstore
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@@ -84,6 +85,10 @@ func ProvideServiceWithReadReplica(primary *SQLStore, cfg *setting.Cfg,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := validateReplicaConfigs(primary.dbCfg, replCfgs); err != nil {
|
||||
return nil, fmt.Errorf("failed to validate replica configurations: %w", err)
|
||||
}
|
||||
|
||||
if len(replCfgs) > 0 {
|
||||
replStore.repls = make([]*SQLStore, len(replCfgs))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user