aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-06-17 17:27:26 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-06-17 17:27:26 +0200
commitda162a1856a32235e619578aa423c43d37791cc1 (patch)
tree9089e4be8cd7394bc29eac45f96d1163f508ca56 /src
parent1b977577d5474faa1ec8857f33346c5d36584211 (diff)
download0tdns-da162a1856a32235e619578aa423c43d37791cc1.tar.gz
0tdns-da162a1856a32235e619578aa423c43d37791cc1.zip
specify timeout when connecting to database
Diffstat (limited to 'src')
-rw-r--r--src/ztdnslib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ztdnslib.py b/src/ztdnslib.py
index 8ac0169..7b8532e 100644
--- a/src/ztdnslib.py
+++ b/src/ztdnslib.py
@@ -13,7 +13,8 @@ def get_ztdns_config():
def start_db_connection(config):
connection = psycopg2.connect(user=config['user'], password=config['password'],
host=config['host'], port=config['port'],
- database=config['database'])
+ database=config['database'],
+ connect_timeout=10)
# we might later decide that each user of start_db_connection()
# should set it themselves - but for now, set it here
connection.autocommit = True