Code Review
/
ric-plt
/
sdlgo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Refactor long readRedisInfoReplyFields() function
[ric-plt/sdlgo.git]
/
internal
/
sdlgoredis
/
sdlgosentinel.go
diff --git
a/internal/sdlgoredis/sdlgosentinel.go
b/internal/sdlgoredis/sdlgosentinel.go
index
f439570
..
19468d7
100644
(file)
--- a/
internal/sdlgoredis/sdlgosentinel.go
+++ b/
internal/sdlgoredis/sdlgosentinel.go
@@
-23,7
+23,9
@@
package sdlgoredis
import (
package sdlgoredis
import (
+ "fmt"
"github.com/go-redis/redis/v7"
"github.com/go-redis/redis/v7"
+ "strconv"
)
type Sentinel struct {
)
type Sentinel struct {
@@
-61,6
+63,14
@@
func (s *Sentinel) GetDbState() (*DbState, error) {
state.PrimaryDbState = *pState
state.ReplicasDbState = rState
state.SentinelsDbState = sState
state.PrimaryDbState = *pState
state.ReplicasDbState = rState
state.SentinelsDbState = sState
+
+ cnt, err := strconv.Atoi(s.Cfg.nodeCnt)
+ if err != nil {
+ state.Err = fmt.Errorf("Sentinel DBAAS_NODE_COUNT configuration value '%s' conversion to integer failed", s.Cfg.nodeCnt)
+ return state, state.Err
+ }
+ state.ConfigNodeCnt = cnt
+
if pErr != nil {
return state, pErr
}
if pErr != nil {
return state, pErr
}