Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ada9e9

Browse files
committed
Patch for an Issue Issue #416
1 parent 084cfc7 commit 2ada9e9

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

lib/core/option.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
from lib.core.settings import IS_WIN
102102
from lib.core.settings import LOCALHOST
103103
from lib.core.settings import MAXDB_ALIASES
104+
from lib.core.settings import MAX_CONNECT_RETRIES
104105
from lib.core.settings import MAX_NUMBER_OF_THREADS
105106
from lib.core.settings import MSSQL_ALIASES
106107
from lib.core.settings import MYSQL_ALIASES
@@ -1431,6 +1432,9 @@ def _cleanupOptions():
14311432
else:
14321433
kb.adjustTimeDelay = ADJUST_TIME_DELAY.DISABLE
14331434

1435+
if conf.retries:
1436+
conf.retries = min(conf.retries, MAX_CONNECT_RETRIES)
1437+
14341438
if conf.code:
14351439
conf.code = int(conf.code)
14361440

lib/core/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@
490490
# Maximum length of a help part containing switch/option name(s)
491491
MAX_HELP_OPTION_LENGTH = 18
492492

493+
# Maximum number of connection retries (to prevent problems with recursion)
494+
MAX_CONNECT_RETRIES = 100
495+
493496
# Strings for detecting formatting errors
494497
FORMAT_EXCEPTION_STRINGS = ("Type mismatch", "Error converting", "Failed to convert", "System.FormatException", "java.lang.NumberFormatException")
495498

0 commit comments

Comments
 (0)