arpakitlib 1.8.179__py3-none-any.whl → 1.8.181__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.
- arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json +1 -1
- arpakitlib/_arpakit_project_template_v_5/project/business_service/exception.py +29 -0
- arpakitlib/ar_safe_func.py +12 -3
- {arpakitlib-1.8.179.dist-info → arpakitlib-1.8.181.dist-info}/METADATA +1 -1
- {arpakitlib-1.8.179.dist-info → arpakitlib-1.8.181.dist-info}/RECORD +8 -7
- {arpakitlib-1.8.179.dist-info → arpakitlib-1.8.181.dist-info}/LICENSE +0 -0
- {arpakitlib-1.8.179.dist-info → arpakitlib-1.8.181.dist-info}/WHEEL +0 -0
- {arpakitlib-1.8.179.dist-info → arpakitlib-1.8.181.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
3
|
+
|
4
|
+
class BaseBusinessServiceException(Exception):
|
5
|
+
def __init__(
|
6
|
+
self,
|
7
|
+
message: str,
|
8
|
+
*,
|
9
|
+
data: dict[str, Any] | None = None
|
10
|
+
):
|
11
|
+
self.message = message
|
12
|
+
if data is None:
|
13
|
+
data = None
|
14
|
+
self.data = data
|
15
|
+
|
16
|
+
def __str__(self):
|
17
|
+
parts = [
|
18
|
+
f"{self.__class__.__name__}"
|
19
|
+
]
|
20
|
+
if self.message is not None:
|
21
|
+
parts.append(f"{str(self.message)}")
|
22
|
+
return ', '.join(parts)
|
23
|
+
|
24
|
+
def __repr__(self):
|
25
|
+
return str(self)
|
26
|
+
|
27
|
+
|
28
|
+
class SimpleBSException(BaseBusinessServiceException):
|
29
|
+
pass
|
arpakitlib/ar_safe_func.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
import datetime as dt
|
3
3
|
from typing import Any
|
4
4
|
|
5
|
-
from pydantic import BaseModel, ConfigDict
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
6
6
|
|
7
7
|
from arpakitlib.ar_datetime_util import now_utc_dt
|
8
8
|
|
@@ -16,6 +16,9 @@ class SafeFuncResult(BaseModel):
|
|
16
16
|
func_result: Any = None
|
17
17
|
exception: Exception | None = None
|
18
18
|
duration: dt.timedelta | None = None
|
19
|
+
func_name: str
|
20
|
+
args: tuple = Field(default_factory=tuple)
|
21
|
+
kwargs: dict = Field(default_factory=dict)
|
19
22
|
|
20
23
|
def simple_dict_for_json(self) -> dict[str, Any]:
|
21
24
|
return {
|
@@ -39,12 +42,18 @@ def sync_safely_run_func(*, sync_func, args: tuple | None = None, kwargs: dict |
|
|
39
42
|
return SafeFuncResult(
|
40
43
|
has_exception=False,
|
41
44
|
func_result=res,
|
42
|
-
duration=duration
|
45
|
+
duration=duration,
|
46
|
+
func_name=sync_func.__name__,
|
47
|
+
args=args,
|
48
|
+
kwargs=kwargs
|
43
49
|
)
|
44
50
|
except Exception as exception:
|
45
51
|
return SafeFuncResult(
|
46
52
|
has_exception=True,
|
47
|
-
exception=exception
|
53
|
+
exception=exception,
|
54
|
+
func_name=sync_func.__name__,
|
55
|
+
args=args,
|
56
|
+
kwargs=kwargs
|
48
57
|
)
|
49
58
|
|
50
59
|
|
@@ -8,7 +8,7 @@ arpakitlib/_arpakit_project_template_v_5/alembic/env.py,sha256=Qesmnj5A2kB-Doeuf
|
|
8
8
|
arpakitlib/_arpakit_project_template_v_5/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
|
9
9
|
arpakitlib/_arpakit_project_template_v_5/alembic/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
arpakitlib/_arpakit_project_template_v_5/alembic.ini,sha256=8fuyeEvGBiPGbxEFy8ISBV3xX_fgVmuhEGpB10_B5Uo,3733
|
11
|
-
arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=
|
11
|
+
arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=yGMimotzllVIiiiLwTg1r-mEIPPqcWN5ZK5kCkX9FHA,98
|
12
12
|
arpakitlib/_arpakit_project_template_v_5/command/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
arpakitlib/_arpakit_project_template_v_5/command/alembic_history.sh,sha256=OMnDNtHIksGh9iavWnzbtxcudZW4vjdcISsBXvzZSPw,22
|
14
14
|
arpakitlib/_arpakit_project_template_v_5/command/alembic_revision_autogenerate.sh,sha256=yW2i-SBOtBx15Ya0poVQqKkJM5t2JZp06r9AEW-DmGE,46
|
@@ -170,6 +170,7 @@ arpakitlib/_arpakit_project_template_v_5/project/api/schema/out/general/user_tok
|
|
170
170
|
arpakitlib/_arpakit_project_template_v_5/project/api/start_api.py,sha256=P5KMtYXujQUP2uAAKgUFyCxG99Fj2vfNf1ZEm8eFH80,532
|
171
171
|
arpakitlib/_arpakit_project_template_v_5/project/api/util.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
172
172
|
arpakitlib/_arpakit_project_template_v_5/project/business_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
173
|
+
arpakitlib/_arpakit_project_template_v_5/project/business_service/exception.py,sha256=HPs7trDBdXEb0B3LCzDIMJd1uSHPIWs7TI43ogWrONU,635
|
173
174
|
arpakitlib/_arpakit_project_template_v_5/project/business_service/hello_world.py,sha256=K0UcmwXuhUxHslOpwQ7h_igIFY4G63ekdhI2RwTWQbE,260
|
174
175
|
arpakitlib/_arpakit_project_template_v_5/project/business_service/remove_operations.py,sha256=E2F8xonPeZovKKOHv-XDmsQUHvks8A6R89PVhF_pAQI,1780
|
175
176
|
arpakitlib/_arpakit_project_template_v_5/project/celery_/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -403,7 +404,7 @@ arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJ
|
|
403
404
|
arpakitlib/ar_rat_func_util.py,sha256=Ca10o3RJwyx_DJLxjTxgHDO6NU3M6CWgUR4bif67OE4,2006
|
404
405
|
arpakitlib/ar_retry_func_util.py,sha256=LB4FJRsu2cssnPw6X8bCEcaGpQsXhkLkgeU37w1t9fU,2250
|
405
406
|
arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
|
406
|
-
arpakitlib/ar_safe_func.py,sha256=
|
407
|
+
arpakitlib/ar_safe_func.py,sha256=ayX0K107yoqPDjpJ4fLvhMg-RX6qQ_w9z9py9i_3dLk,2168
|
407
408
|
arpakitlib/ar_schedule_uust_api_client_util.py,sha256=rXI2_3OTaIBgR-GixM1Ti-Ue1f9nOcO3EUpYRqdGpYM,6973
|
408
409
|
arpakitlib/ar_settings_util.py,sha256=Y5wi_cmsjDjfJpM0VJHjbo0NoVPKfypKaD1USowwDtQ,1327
|
409
410
|
arpakitlib/ar_sleep_util.py,sha256=ggaj7ML6QK_ADsHMcyu6GUmUpQ_9B9n-SKYH17h-9lM,1045
|
@@ -412,8 +413,8 @@ arpakitlib/ar_sqlalchemy_util.py,sha256=w_tGPTWIMVjHkTEYo9tVe1sfK_4vvfd3zGATLiYC
|
|
412
413
|
arpakitlib/ar_str_util.py,sha256=2lGpnXDf2h1cBZpVf5i1tX_HCv5iBd6IGnrCw4QWWlY,4350
|
413
414
|
arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
|
414
415
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
|
415
|
-
arpakitlib-1.8.
|
416
|
-
arpakitlib-1.8.
|
417
|
-
arpakitlib-1.8.
|
418
|
-
arpakitlib-1.8.
|
419
|
-
arpakitlib-1.8.
|
416
|
+
arpakitlib-1.8.181.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
417
|
+
arpakitlib-1.8.181.dist-info/METADATA,sha256=6qSFkIGWOi8Hk8IZWHgyYOokdb-kSvLxQf9UU6Psi2A,3741
|
418
|
+
arpakitlib-1.8.181.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
419
|
+
arpakitlib-1.8.181.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
420
|
+
arpakitlib-1.8.181.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|