Skip to content

Commit b89b84d

Browse files
authored
Redis 始终 提示 ERROR
1. 去掉了 `require 'redis/namespace'` 2. 将默认端口由 `3306` 改为 `6379` 3. 现在已经没有 `disconnect` 方法了,改为 `close` 以上,可以正常显示 `OK` 了
1 parent adb5a81 commit b89b84d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/status-page/services/redis.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'redis/namespace'
2-
31
module StatusPage
42
module Services
53
class RedisException < StandardError; end
@@ -9,7 +7,7 @@ class Configuration
97
attr_accessor :url
108

119
def initialize
12-
@url = "redis://127.0.0.1:3306/1"
10+
@url = "redis://127.0.0.1:6379/1"
1311
end
1412
end
1513

@@ -30,7 +28,7 @@ def check!
3028
rescue Exception => e
3129
raise RedisException.new(e.message)
3230
ensure
33-
redis.disconnect
31+
redis.close
3432
end
3533

3634
private

0 commit comments

Comments
 (0)