Skip to content

Commit ecf8dde

Browse files
committed
Merge branch 'azure-1.11' into azure-2.0
2 parents aec70a3 + ba68198 commit ecf8dde

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ Dictionary. Current available keys are:
192192
Integer. Sets the back off time in seconds for reries of
193193
the database connection process. Default value is ``5``.
194194

195+
- query_timeout
196+
197+
Integer. Sets the timeout in seconds for the database query.
198+
Default value is ``0`` which disables the timeout.
199+
195200
backend-specific settings
196201
~~~~~~~~~~~~~~~~~~~~~~~~~
197202

sql_server/pyodbc/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ def get_new_connection(self, conn_params):
295295
timeout = options.get('connection_timeout', 0)
296296
retries = options.get('connection_retries', 5)
297297
backoff_time = options.get('connection_retry_backoff_time', 5)
298+
query_timeout = options.get('query_timeout', 0)
298299

299300
conn = None
300301
retry_count = 0
@@ -317,6 +318,7 @@ def get_new_connection(self, conn_params):
317318
if not need_to_retry:
318319
raise
319320

321+
conn.timeout = query_timeout
320322
return conn
321323

322324
def init_connection_state(self):

0 commit comments

Comments
 (0)