File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,11 @@ Dictionary. Current available keys are:
203203 Integer. Sets the back off time in seconds for reries of
204204 the database connection process. Default value is ``5 ``.
205205
206+ - query_timeout
207+
208+ Integer. Sets the timeout in seconds for the database query.
209+ Default value is ``0 `` which disables the timeout.
210+
206211backend-specific settings
207212~~~~~~~~~~~~~~~~~~~~~~~~~
208213
Original file line number Diff line number Diff line change @@ -301,6 +301,7 @@ def get_new_connection(self, conn_params):
301301 timeout = options .get ('connection_timeout' , 0 )
302302 retries = options .get ('connection_retries' , 5 )
303303 backoff_time = options .get ('connection_retry_backoff_time' , 5 )
304+ query_timeout = options .get ('query_timeout' , 0 )
304305
305306 conn = None
306307 retry_count = 0
@@ -323,6 +324,7 @@ def get_new_connection(self, conn_params):
323324 if not need_to_retry :
324325 raise
325326
327+ conn .timeout = query_timeout
326328 return conn
327329
328330 def init_connection_state (self ):
You can’t perform that action at this time.
0 commit comments