internal 0.1.33__py3-none-any.whl → 0.1.35__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.

Potentially problematic release.


This version of internal might be problematic. Click here for more details.

internal/base_config.py CHANGED
@@ -26,5 +26,16 @@ class BaseConfig(BaseSettings):
26
26
  DATABASE_URL: str = ""
27
27
  DATABASE_NAME: str = ""
28
28
 
29
+ # Micro Service
30
+ AUTH_BASE_URL: str = ""
31
+ ORGANIZATION_BASE_URL: str = ""
32
+ CUSTOMER_BASE_URL: str = ""
33
+ CAR_BASE_URL: str = ""
34
+ RELATIONSHIP_MANAGEMENT_BASE_URL: str = ""
35
+ TICKET_BASE_URL: str = ""
36
+ NOTIFY_BASE_URL: str = ""
37
+ THIRD_PARTY_BASE_URL: str = ""
38
+ SCHEDULER_BASE_URL: str = ""
39
+
29
40
  class Config:
30
41
  case_sensitive = False
internal/http/requests.py CHANGED
@@ -2,11 +2,22 @@ import httpx
2
2
 
3
3
  from fastapi import FastAPI
4
4
 
5
+ from ..exception.internal_exception import GatewayTimeoutException, BadGatewayException
6
+
5
7
 
6
8
  async def async_request(app: FastAPI, method, url, **kwargs):
7
9
  timeout = httpx.Timeout(connect=app.state.config.REQUEST_CONN_TIMEOUT, read=app.state.config.REQUEST_READ_TIMEOUT,
8
10
  write=app.state.config.REQUEST_WRITE_TIMEOUT, pool=app.state.config.REQUEST_POOL_TIMEOUT)
9
11
 
10
- async with httpx.AsyncClient(timeout=timeout) as client:
11
- response = await client.request(method, url, **kwargs)
12
- return response
12
+ try:
13
+ async with httpx.AsyncClient(timeout=timeout) as client:
14
+ response = await client.request(method, url, **kwargs)
15
+ return response
16
+ except httpx.TimeoutException as exc:
17
+ app.state.logger.error(
18
+ f"async_request(), TimeoutException, exc: {exc}, url: {url}, method: {method}, kwargs: {kwargs}")
19
+ raise GatewayTimeoutException()
20
+ except Exception as exc:
21
+ app.state.logger.error(
22
+ f"async_request(), Exception, exc: {exc}, url: {url}, method: {method}, kwargs: {kwargs}")
23
+ raise BadGatewayException()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: internal
3
- Version: 0.1.33
3
+ Version: 0.1.35
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -1,5 +1,5 @@
1
1
  internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- internal/base_config.py,sha256=AdNe4H3aOaqj6aquhTjnPxogsKbzAI3i89jxmGxozxg,701
2
+ internal/base_config.py,sha256=M2HMhJAerOHppSqy1O2J0tGrC5cTGmouf3Cyu0YfIXo,1020
3
3
  internal/base_factory.py,sha256=ugg3IW6N1FdgcME7Wvicu75tp9_XGkaSz_e1tvoUuqM,6256
4
4
  internal/const.py,sha256=U1S9r7bjtHgad2oYQoHO19s8D4V0WDUG-L-haV4UaIw,1025
5
5
  internal/database.py,sha256=MyRLlb0W8FB8Odq0UQpN3R7OD3yUPWgJXsZRuDWQC_w,1010
@@ -11,7 +11,7 @@ internal/ext/amazon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
11
11
  internal/ext/amazon/aws/__init__.py,sha256=2YFjb-rHG1JaZGZiZffYDesgTAJjDshOqQbswOYzhP8,834
12
12
  internal/ext/amazon/aws/const.py,sha256=l4WMg5bKWujwOKABBkCO2zclNg3abnYOfbhD7DG8GsA,109
13
13
  internal/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- internal/http/requests.py,sha256=1LMKuUb1RU0tpJHektFhRkvGULyZg-XbIh1pmTS4vdY,492
14
+ internal/http/requests.py,sha256=ilifw2CcVpI_PiIG1rY4jyeE4wLY5A2jL1f2mguPx_Q,1026
15
15
  internal/http/responses.py,sha256=DADdRfyk8RerhGLVzqoy5OT2SeAX-po2X-aMqEvj_Eg,1498
16
16
  internal/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  internal/interface/base_interface.py,sha256=R5MmO5oa5-ORPV_adkegLVCwsVio2zFOuQFGiby3khs,340
@@ -19,6 +19,6 @@ internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  internal/model/base_model.py,sha256=gNbixWuGiK8Tbe78wHuLneZ8p3fwMwQRKurBDrGoh6s,1874
20
20
  internal/model/operate.py,sha256=3mOs7eQ2CPnCB6i6UQBOp8VdTPmVnayaUFqUEDOKoTY,1493
21
21
  internal/utils.py,sha256=0SubS0iUhDvjSX1F4TykasA5-enYJzt2VH-f7_0BnjI,1509
22
- internal-0.1.33.dist-info/METADATA,sha256=zYWc-qGixejnD_atwf5x73hkGL1ISTxx4Pk_50LYHlg,625
23
- internal-0.1.33.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
24
- internal-0.1.33.dist-info/RECORD,,
22
+ internal-0.1.35.dist-info/METADATA,sha256=dH6MQcXcPvUxVPEgPqn2gtzgOXvqjMWyjRImr4MUziM,625
23
+ internal-0.1.35.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
24
+ internal-0.1.35.dist-info/RECORD,,