如何判斷 redis 連接是否有效
3 回答

慕虎7371278
TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超4個(gè)贊
>>> conn = redis.StrictRedis('1.2.3.4', 1234, socket_timeout=3)
>>> conn.get('xxxxxxxxxxxxx')
......
redis.exceptions.ConnectionError: Error connecting to 1.2.3.4:1234. timed out.
- 3 回答
- 0 關(guān)注
- 7250 瀏覽
添加回答
舉報(bào)
0/150
提交
取消