maleo-foundation 0.3.38__py3-none-any.whl → 0.3.41__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.
- maleo_foundation/models/transfers/general/configurations/cache/redis.py +1 -1
- maleo_foundation/utils/cache.py +10 -3
- {maleo_foundation-0.3.38.dist-info → maleo_foundation-0.3.41.dist-info}/METADATA +1 -1
- {maleo_foundation-0.3.38.dist-info → maleo_foundation-0.3.41.dist-info}/RECORD +6 -6
- {maleo_foundation-0.3.38.dist-info → maleo_foundation-0.3.41.dist-info}/WHEEL +0 -0
- {maleo_foundation-0.3.38.dist-info → maleo_foundation-0.3.41.dist-info}/top_level.txt +0 -0
@@ -15,7 +15,7 @@ class RedisCacheNamespaces(BaseModel):
|
|
15
15
|
return ":".join([self.base if base_override is None else base_override, type, *ext])
|
16
16
|
|
17
17
|
class RedisCacheConfigurations(BaseModel):
|
18
|
-
ttl: Union[int, float] = Field(BaseEnums.
|
18
|
+
ttl: Union[int, float] = Field(BaseEnums.Expiration.EXP_5MN, description="Default TTL")
|
19
19
|
namespaces: RedisCacheNamespaces = Field(..., description="Redis cache's namepsaces")
|
20
20
|
host: str = Field(..., description="Redis instance's host")
|
21
21
|
port: int = Field(6379, description="Redis instance's port")
|
maleo_foundation/utils/cache.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import json
|
2
|
-
from typing import Callable
|
3
2
|
from fastapi.encoders import jsonable_encoder
|
3
|
+
from pydantic import BaseModel
|
4
|
+
from typing import Callable
|
4
5
|
|
5
6
|
def key_builder(
|
6
7
|
func: Callable,
|
@@ -10,14 +11,20 @@ def key_builder(
|
|
10
11
|
arg_values = []
|
11
12
|
for arg in args:
|
12
13
|
try:
|
13
|
-
|
14
|
+
if isinstance(arg, BaseModel) and hasattr(arg, "model_dump"):
|
15
|
+
arg_values.append(arg.model_dump(mode="json"))
|
16
|
+
else:
|
17
|
+
arg_values.append(jsonable_encoder(arg))
|
14
18
|
except Exception:
|
15
19
|
arg_values.append(str(arg))
|
16
20
|
|
17
21
|
kwarg_values = {}
|
18
22
|
for k, v in kwargs.items():
|
19
23
|
try:
|
20
|
-
|
24
|
+
if isinstance(v, BaseModel) and hasattr(arg, "model_dump"):
|
25
|
+
kwarg_values[k] = v.model_dump(mode="json")
|
26
|
+
else:
|
27
|
+
kwarg_values[k] = jsonable_encoder(v)
|
21
28
|
except Exception:
|
22
29
|
kwarg_values[k] = str(v)
|
23
30
|
|
@@ -76,7 +76,7 @@ maleo_foundation/models/transfers/general/configurations/database.py,sha256=v-Iz
|
|
76
76
|
maleo_foundation/models/transfers/general/configurations/middleware.py,sha256=-6dk6C2QBDfmTDENhsgyMHpRUGfrSxQY3BDwo_WtgAs,1710
|
77
77
|
maleo_foundation/models/transfers/general/configurations/service.py,sha256=8lag1KXkS43IwsMGWka7L-peQ9YT1-dmWeEhQ1hnnLU,304
|
78
78
|
maleo_foundation/models/transfers/general/configurations/cache/__init__.py,sha256=a7p5LWkQJlgcfKpdJrKnCfe1LUAnwltXwTOThANlR6s,286
|
79
|
-
maleo_foundation/models/transfers/general/configurations/cache/redis.py,sha256=
|
79
|
+
maleo_foundation/models/transfers/general/configurations/cache/redis.py,sha256=f4Djq1Uo2IvVNpclKtNCtcXnb9ghzX76HshEQGULo8k,1164
|
80
80
|
maleo_foundation/models/transfers/general/configurations/client/__init__.py,sha256=2Iln1K23ad283y_PxVf4Zo25LZrGlrIIYlqm0cCFO5U,331
|
81
81
|
maleo_foundation/models/transfers/general/configurations/client/maleo.py,sha256=0ecfHUW-gkmUZBrCINdoFJN9t03VGV9a8ND1D-LpmNc,1741
|
82
82
|
maleo_foundation/models/transfers/parameters/__init__.py,sha256=oKW4RPIEISISRjsJzD8lsCGY1HhZRTzshPpWHcJu86k,353
|
@@ -111,7 +111,7 @@ maleo_foundation/models/transfers/results/service/repository.py,sha256=djITRZh2j
|
|
111
111
|
maleo_foundation/models/transfers/results/service/controllers/__init__.py,sha256=HZJWMy2dskzOCzLmp_UaL9rjbQ-sDMI7sd2bXb-4QOU,175
|
112
112
|
maleo_foundation/models/transfers/results/service/controllers/rest.py,sha256=txZG-yFttHTla8-m85taLt8lrt-n3NeYVvRPGQnGm4M,1124
|
113
113
|
maleo_foundation/utils/__init__.py,sha256=ZZv0NDcTdHsHl51EKfgrlCm8CQmgvyIndMcQABDudN0,391
|
114
|
-
maleo_foundation/utils/cache.py,sha256=
|
114
|
+
maleo_foundation/utils/cache.py,sha256=0CRzo64b3XDTWaCRf9cWLdOwWLtjBgbFEIOXcz_I3I8,1078
|
115
115
|
maleo_foundation/utils/client.py,sha256=CGwn8eH5WlwnE5tPMfMAH5V3BItBgVmYBZnXpLjTVSc,2826
|
116
116
|
maleo_foundation/utils/controller.py,sha256=Ub1R-JN6spmXakYrOY7igwaNt4Sg8LASASdXymxZcCI,6954
|
117
117
|
maleo_foundation/utils/exceptions.py,sha256=z24kzEP2geaAEElxXaEy7ln6KodebXvtlu-h1inZ_nw,6376
|
@@ -133,7 +133,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
|
|
133
133
|
maleo_foundation/utils/loaders/credential/google.py,sha256=ZglnLdW3lHmaKER4mwGe5N5ERus-bdsamfpwGmQYPIo,6344
|
134
134
|
maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
|
135
135
|
maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
|
136
|
-
maleo_foundation-0.3.
|
137
|
-
maleo_foundation-0.3.
|
138
|
-
maleo_foundation-0.3.
|
139
|
-
maleo_foundation-0.3.
|
136
|
+
maleo_foundation-0.3.41.dist-info/METADATA,sha256=gnWHx-x3Qm65sXrWaJlaSa5zKur-nbQtrgpduf765HM,3740
|
137
|
+
maleo_foundation-0.3.41.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
138
|
+
maleo_foundation-0.3.41.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
|
139
|
+
maleo_foundation-0.3.41.dist-info/RECORD,,
|
File without changes
|
File without changes
|