File tree Expand file tree Collapse file tree 4 files changed +14
-14
lines changed
Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ REDIS_FIRST_PORT := $(firstword $(TEST_REDIS_PORTS))
2121REDIS_SLAVE_ARG := --slaveof 127.0.0.1 $(REDIS_FIRST_PORT )
2222REDIS_CLI := redis-cli -p $(REDIS_FIRST_PORT ) -n $(TEST_REDIS_DATABASE )
2323
24- # Override socket for running make test on its own
24+ # Override socket for running make test on its own
2525# (make test TEST_REDIS_SOCKET=/path/to/sock.sock)
2626TEST_REDIS_SOCKET ?= $(REDIS_PREFIX )$(REDIS_FIRST_PORT )$(REDIS_SOCK )
2727
@@ -95,7 +95,7 @@ start_redis_instances: check_ports create_sentinel_config
9595 ) true
9696
9797
98- stop_redis_instances : delete_sentinel_config
98+ stop_redis_instances : delete_sentinel_config
9999 -@$(foreach port,$(TEST_REDIS_PORTS ) $(TEST_SENTINEL_PORTS ) , \
100100 $(MAKE ) stop_redis_instance cleanup_redis_instance port=$(port ) \
101101 prefix=$(REDIS_PREFIX )$(port ) && \
Original file line number Diff line number Diff line change 11# lua-resty-redis-connector
22
33Connection utilities for [ lua-resty-redis] ( https://github.com/openresty/lua-resty-redis ) , making
4- it easy and reliable to connect to Redis hosts, either directly or via
4+ it easy and reliable to connect to Redis hosts, either directly or via
55[ Redis Sentinel] ( http://redis.io/topics/sentinel ) .
66
77
@@ -70,7 +70,7 @@ The defaults are as follows:
7070}
7171```
7272
73- Note that if ` sentinel:// ` is supplied as the ` url ` parameter, a table of ` sentinels ` must also
73+ Note that if ` sentinel:// ` is supplied as the ` url ` parameter, a table of ` sentinels ` must also
7474be supplied. e.g.
7575
7676``` lua
@@ -190,7 +190,7 @@ James Hurst <james@pintsized.co.uk>
190190
191191This module is licensed under the 2-clause BSD license.
192192
193- Copyright (c) 2015, James Hurst < james@pintsized.co.uk >
193+ Copyright (c) James Hurst < james@pintsized.co.uk >
194194
195195All rights reserved.
196196
Original file line number Diff line number Diff line change @@ -77,12 +77,12 @@ local function parse_dsn(params)
7777 elseif m [1 ] == " sentinel" then
7878 fields = { " password" , " master_name" , " role" , " db" }
7979 end
80-
80+
8181 -- password may not be present
8282 if # m < 5 then tbl_remove (fields , 1 ) end
8383
8484 local roles = { m = " master" , s = " slave" , a = " any" }
85-
85+
8686 for i ,v in ipairs (fields ) do
8787 params [v ] = m [i + 1 ]
8888 if v == " role" then
@@ -100,8 +100,8 @@ function _M.connect(self, params)
100100 params = {}
101101 end
102102
103- if params .url then
104- parse_dsn (params )
103+ if params .url then
104+ parse_dsn (params )
105105 end
106106
107107 if params .sentinels then
188188-- the last error received, and previous_errors is a table of the previous errors.
189189function _M .try_hosts (self , hosts )
190190 local errors = tbl_new (# hosts , 0 )
191-
191+
192192 for i , host in ipairs (hosts ) do
193193 local r
194194 r , errors [i ] = self :connect_to_host (host )
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ set dog: OK
7878 ngx.say("failed to connect: ", err)
7979 return
8080 end
81-
81+
8282 -- Print the failed connection errors
8383 ngx.say("connection 1 error: ", err)
8484
@@ -149,8 +149,8 @@ set dog: OK
149149 local redis_connector = require "resty.redis.connector"
150150 local rc = redis_connector.new()
151151
152- local host = {
153- host = "127.0.0.1",
152+ local host = {
153+ host = "127.0.0.1",
154154 port = $TEST_NGINX_REDIS_PORT,
155155 db = 1,
156156 }
@@ -160,7 +160,7 @@ set dog: OK
160160 ngx.say("failed to connect: ", err)
161161 return
162162 end
163-
163+
164164 local res, err = redis:set("dog", "an animal")
165165 if not res then
166166 ngx.say("failed to set dog: ", err)
You can’t perform that action at this time.
0 commit comments