re-common 10.0.25__py3-none-any.whl → 10.0.26__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,10 +19,27 @@ DB_CONFIG = {
19
19
  'echo': False, # 打印SQL语句
20
20
  }
21
21
 
22
+ DB_CONFIG1 = {
23
+ 'host': '192.168.98.55',
24
+ 'port': 4000,
25
+ 'user': 'foreign_fulltextUser',
26
+ 'password': 'i4hIeasw1qpmhGN2nwL7',
27
+ 'db': 'foreign_fulltext',
28
+ 'charset': 'utf8mb4',
29
+ 'minsize': 16, # 最小连接数
30
+ 'maxsize': 128, # 最大连接数
31
+ 'autocommit': False, # 自动提交事务
32
+ 'pool_recycle': 3600, # 每个连接的回收时间(秒),超过此时间后连接将被关闭并重新创建,避免失效连接
33
+ 'echo': False, # 打印SQL语句
34
+ }
35
+
22
36
 
23
37
  @asynccontextmanager
24
- async def get_db_pool():
38
+ async def get_db_pool(_DB_CONFIG: dict = None):
25
39
  """异步数据库连接池管理工具"""
40
+ global DB_CONFIG
41
+ if _DB_CONFIG is not None:
42
+ DB_CONFIG = _DB_CONFIG
26
43
  pool: Pool = await aiomysql.create_pool(**DB_CONFIG)
27
44
  try:
28
45
  yield pool
@@ -54,4 +71,4 @@ async def init_aiomysql_pool_async():
54
71
  if aiomysql_pool is None:
55
72
  print(f"[{os.getpid()}] Initializing aiomysql pool...")
56
73
  aiomysql_pool = await aiomysql.create_pool(**DB_CONFIG)
57
- return aiomysql_pool
74
+ return aiomysql_pool
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: re_common
3
- Version: 10.0.25
3
+ Version: 10.0.26
4
4
  Summary: a library about all python projects
5
5
  Home-page: https://gitee.com/xujiangios/re-common
6
6
  Author: vic
@@ -195,7 +195,7 @@ re_common/v2/baselibrary/utils/basedict.py,sha256=sH3_RZ8u4649-jX2V1uKNNkjJVUijZ
195
195
  re_common/v2/baselibrary/utils/basehdfs.py,sha256=TPwFct_-UrmO1KCbo4gpV77rsnlCQDumNBbQKL0ZI9o,5953
196
196
  re_common/v2/baselibrary/utils/basepika.py,sha256=ifOb3UsGj79k40aD9UK6-5BMPw43ZAo0SO3AYD4q4vw,7332
197
197
  re_common/v2/baselibrary/utils/basetime.py,sha256=b7U_ho6nE3fjYBxSkdMHXUOd3ClH6KkW_7p7l2Gs4gA,3038
198
- re_common/v2/baselibrary/utils/db.py,sha256=0aVNth5g5KizrxHrXtp1b8Na5oZvof2hL_XVqBYNi6Q,1672
198
+ re_common/v2/baselibrary/utils/db.py,sha256=ouDagXqqY9h4ucK4LDGrYVY-31rOiBQFxXLIlio9AJA,2297
199
199
  re_common/v2/baselibrary/utils/json_cls.py,sha256=M93piYtmgm_wP8E57culTrd_AhHLoGg6PqeAJYdW2SM,438
200
200
  re_common/v2/baselibrary/utils/mq.py,sha256=UHpO8iNIHs91Tgp-BgnSUpZwjWquxrGLdpr3FMMv2zw,2858
201
201
  re_common/v2/baselibrary/utils/n_ary_expression_tree.py,sha256=-05kO6G2Rth7CEK-5lfFrthFZ1Q0-0a7cni7mWZ-2gg,9172
@@ -229,8 +229,8 @@ re_common/vip/title/transform/TransformRegulationTitleToZt.py,sha256=LKRdIsWKues
229
229
  re_common/vip/title/transform/TransformStandardTitleToZt.py,sha256=-fCKAbSBzXVyQDCE61CalvR9E_QzQMA08QOO_NePFNI,5563
230
230
  re_common/vip/title/transform/TransformThesisTitleToZt.py,sha256=QS-uV0cQrpUFAcKucuJQ9Ue2VRQH-inmfn_X3IplfRo,5488
231
231
  re_common/vip/title/transform/__init__.py,sha256=m83-CWyRq_VHPYHaALEQlmXrkTdrZ3e4B_kCfBYE-uc,239
232
- re_common-10.0.25.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
233
- re_common-10.0.25.dist-info/METADATA,sha256=wicJDzxXN8liL_MMiv2eoq5RvkYlsl9wxDulF-BNTJI,582
234
- re_common-10.0.25.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
235
- re_common-10.0.25.dist-info/top_level.txt,sha256=_H9H23zoLIalm1AIY_KYTVh_H0ZnmjxQIxsvXtLv45o,10
236
- re_common-10.0.25.dist-info/RECORD,,
232
+ re_common-10.0.26.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
233
+ re_common-10.0.26.dist-info/METADATA,sha256=kHLVPF-e0PjpnUL7dN9pAMqK_pw4yHwZGKxbJ_zlAY0,582
234
+ re_common-10.0.26.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
235
+ re_common-10.0.26.dist-info/top_level.txt,sha256=_H9H23zoLIalm1AIY_KYTVh_H0ZnmjxQIxsvXtLv45o,10
236
+ re_common-10.0.26.dist-info/RECORD,,