File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -610,14 +610,19 @@ qr/property \"rate\" validation failed: expected 0 to be greater than 0/
610610--- config
611611 location /t {
612612 content_by_lua_block {
613- local redis_cluster = require " resty. rediscluster"
614- local red_c = redis_cluster : new( {
615- name = " test" ,
616- serv_list = {
617- { ip = " 127.0.0.1" , port = 5000 } ,
618- { ip = " 127.0.0.1" , port = 5002 }
613+ local redis_cluster = require ( " apisix.utils. rediscluster" )
614+ local conf = {
615+ redis_cluster_name = " test" ,
616+ redis_cluster_nodes = {
617+ " 127.0.0.1: 5000" ,
618+ " 127.0.0.1: 5002"
619619 }
620- }, " plugin-limit-req-redis-cluster-slot-lock" )
620+ }
621+ local red_c, err = redis_cluster. new (conf, " plugin-limit-req-redis-cluster-slot-lock" )
622+ if not red_c then
623+ ngx. say (" Failed to create Redis cluster client: " , err)
624+ return
625+ end
621626
622627 -- Clean up any existing keys
623628 red_c: del(" limit_req:{ test_key} :state" )
You can’t perform that action at this time.
0 commit comments