1585346868 8 месяцев назад
Родитель
Сommit
50bba5fdf0
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      target/redis/pool.lua

+ 6 - 2
target/redis/pool.lua

@@ -7,9 +7,13 @@ redis_pool.__index = redis_pool
     创建一个新的 fw_redis_pool 对象
     创建一个新的 fw_redis_pool 对象
     @return 返回一个新的 fw_redis_pool 对象
     @return 返回一个新的 fw_redis_pool 对象
 ]]
 ]]
-function redis_pool.new()
+function redis_pool.new(pool)
     local instance = setmetatable({}, redis_pool)
     local instance = setmetatable({}, redis_pool)
-    instance.module = fw_redis_pool.new()
+    if pool == nil then
+        instance.module = fw_redis_pool.new()
+    else
+        instance.module = pool
+    end
     return instance
     return instance
 end
 end