浏览代码

Set redis socket timeout to 5s

Ben Firshman 9 年之前
父节点
当前提交
1a0b0c8b54
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      voting-app/app.py

+ 1 - 1
voting-app/app.py

@@ -13,7 +13,7 @@ app = Flask(__name__)
 
 def get_redis():
     if not hasattr(g, 'redis'):
-        g.redis = Redis(host="redis", db=0)
+        g.redis = Redis(host="redis", db=0, socket_timeout=5)
     return g.redis
 
 @app.route("/", methods=['POST','GET'])