如何判断 redis 连接是否有效

如何判断 redis 连接是否有效


慕容3067478
浏览 7128回答 3
3回答

慕虎7371278

>>> 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.
打开App,查看更多内容
随时随地看视频慕课网APP