From 92239efe147f35c4f8cc8cee808e977cf17c9d04 Mon Sep 17 00:00:00 2001 From: hyokeun Date: Mon, 12 Feb 2018 14:13:34 +0900 Subject: [PATCH] DB connect timeout to 3 seconds Change-Id: I2dd5fb6683533397aea2d75aa2ef8e1509853a7f --- common/buildmonitor_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/buildmonitor_db.py b/common/buildmonitor_db.py index b03022c..0e42a57 100644 --- a/common/buildmonitor_db.py +++ b/common/buildmonitor_db.py @@ -99,7 +99,7 @@ def connect_db(): print '%s %s %s' % (db_ip, db_user, db_name) # MySQL connect & get version - conn = MySQLdb.connect(db_ip, db_user, db_pass, db_name) + conn = MySQLdb.connect(db_ip, db_user, db_pass, db_name, connect_timeout=3) cursor = conn.cursor() query = "SELECT VERSION()" version = '' -- 2.7.4