Skip to content

Commit 414fa01

Browse files
committed
updates to main.go
1 parent 93fb5c3 commit 414fa01

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

guestbook-go/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ import (
2929

3030
var (
3131
masterPool *simpleredis.ConnectionPool
32-
slavePool *simpleredis.ConnectionPool
32+
replicaPool *simpleredis.ConnectionPool
3333
)
3434

3535
func ListRangeHandler(rw http.ResponseWriter, req *http.Request) {
3636
key := mux.Vars(req)["key"]
37-
list := simpleredis.NewList(slavePool, key)
37+
list := simpleredis.NewList(replicaPool, key)
3838
members := HandleError(list.GetAll()).([]string)
3939
membersJSON := HandleError(json.MarshalIndent(members, "", " ")).([]byte)
4040
rw.Write(membersJSON)
@@ -76,8 +76,8 @@ func HandleError(result interface{}, err error) (r interface{}) {
7676
func main() {
7777
masterPool = simpleredis.NewConnectionPoolHost("redis-master:6379")
7878
defer masterPool.Close()
79-
slavePool = simpleredis.NewConnectionPoolHost("redis-slave:6379")
80-
defer slavePool.Close()
79+
replicaPool = simpleredis.NewConnectionPoolHost("redis-slave:6379")
80+
defer replicaPool.Close()
8181

8282
r := mux.NewRouter()
8383
r.Path("/lrange/{key}").Methods("GET").HandlerFunc(ListRangeHandler)

0 commit comments

Comments
 (0)