fix redis max_conn
Showing
2 changed files
with
4 additions
and
4 deletions
... | @@ -41,7 +41,7 @@ def url_to_parts(url): | ... | @@ -41,7 +41,7 @@ def url_to_parts(url): |
41 | 41 | ||
42 | class Redis: | 42 | class Redis: |
43 | 43 | ||
44 | def __init__(self, url, connection_pool=None, max_connections=10, socket_timeout=120, | 44 | def __init__(self, url, connection_pool=None, max_connections=20, socket_timeout=120, |
45 | retry_on_timeout=None, socket_connect_timeout=None): | 45 | retry_on_timeout=None, socket_connect_timeout=None): |
46 | self._ConnectionPool = connection_pool | 46 | self._ConnectionPool = connection_pool |
47 | scheme, host, port, _, password, path, query = url_to_parts(url) | 47 | scheme, host, port, _, password, path, query = url_to_parts(url) | ... | ... |
1 | import pyodbc | 1 | import pyodbc |
2 | 2 | ||
3 | cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=47.97.220.40;UID=SA;PWD=19951019Mssql', autocommit=True) | 3 | cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=localhost;UID=SA;PWD=pwd', autocommit=True) |
4 | 4 | ||
5 | cursor = cnxn.cursor() | 5 | cursor = cnxn.cursor() |
6 | cursor.execute("create database afc") | 6 | cursor.execute("create database afc") |
... | @@ -436,7 +436,7 @@ afc_sql = """ | ... | @@ -436,7 +436,7 @@ afc_sql = """ |
436 | on afc_doc (application_id, status); | 436 | on afc_doc (application_id, status); |
437 | """ | 437 | """ |
438 | 438 | ||
439 | hil_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=47.97.220.40;DATABASE=hil;UID=SA;PWD=pwd', autocommit=True) | 439 | hil_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=localhost;DATABASE=hil;UID=SA;PWD=pwd', autocommit=True) |
440 | 440 | ||
441 | hil_cursor = hil_cnxn.cursor() | 441 | hil_cursor = hil_cnxn.cursor() |
442 | hil_cursor.execute(hil_sql_1) | 442 | hil_cursor.execute(hil_sql_1) |
... | @@ -445,7 +445,7 @@ hil_cursor.execute(hil_sql_2) | ... | @@ -445,7 +445,7 @@ hil_cursor.execute(hil_sql_2) |
445 | hil_cursor.close() | 445 | hil_cursor.close() |
446 | hil_cnxn.close() | 446 | hil_cnxn.close() |
447 | 447 | ||
448 | afc_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=47.97.220.40;DATABASE=afc;UID=SA;PWD=pwd', autocommit=True) | 448 | afc_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=localhost;DATABASE=afc;UID=SA;PWD=pwd', autocommit=True) |
449 | 449 | ||
450 | afc_cursor = afc_cnxn.cursor() | 450 | afc_cursor = afc_cnxn.cursor() |
451 | afc_cursor.execute(afc_sql) | 451 | afc_cursor.execute(afc_sql) | ... | ... |
-
Please register or sign in to post a comment