Commit 6572554c by lanrion

hot fix for without redis config

parent daf34aa0
...@@ -27,7 +27,7 @@ module WeixinAuthorize ...@@ -27,7 +27,7 @@ module WeixinAuthorize
end end
def weixin_redis def weixin_redis
WeixinAuthorize.config.redis WeixinAuthorize.weixin_redis
end end
end end
......
...@@ -10,7 +10,7 @@ module WeixinAuthorize ...@@ -10,7 +10,7 @@ module WeixinAuthorize
end end
def self.init_with(client) def self.init_with(client)
if WeixinAuthorize.config.redis.nil? if WeixinAuthorize.weixin_redis.nil?
ClientStorage.new(client) ClientStorage.new(client)
else else
RedisStorage.new(client) RedisStorage.new(client)
......
...@@ -7,6 +7,11 @@ module WeixinAuthorize ...@@ -7,6 +7,11 @@ module WeixinAuthorize
def configure def configure
yield self.config ||= Config.new yield self.config ||= Config.new
end end
def weixin_redis
return nil if WeixinAuthorize.config.nil?
@redis ||= WeixinAuthorize.config.redis
end
end end
class Config class Config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment