arpakitlib 1.5.26__py3-none-any.whl → 1.5.28__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/ar_arpakit_schedule_uust_api_client.py +2 -2
- arpakitlib/ar_base_worker.py +9 -9
- arpakitlib/ar_dream_ai_api_client.py +2 -2
- arpakitlib/ar_fastapi_util.py +13 -14
- arpakitlib/ar_http_request_util.py +3 -3
- arpakitlib/ar_operation_execution_util.py +51 -0
- arpakitlib/ar_schedule_uust_api_client.py +2 -1
- arpakitlib/ar_sleep_util.py +68 -0
- arpakitlib/ar_sqlalchemy_model_util.py +3 -0
- arpakitlib/ar_yookassa_api_client.py +3 -3
- {arpakitlib-1.5.26.dist-info → arpakitlib-1.5.28.dist-info}/METADATA +1 -1
- {arpakitlib-1.5.26.dist-info → arpakitlib-1.5.28.dist-info}/RECORD +15 -14
- arpakitlib/ar_safe_sleep.py +0 -25
- {arpakitlib-1.5.26.dist-info → arpakitlib-1.5.28.dist-info}/LICENSE +0 -0
- {arpakitlib-1.5.26.dist-info → arpakitlib-1.5.28.dist-info}/NOTICE +0 -0
- {arpakitlib-1.5.26.dist-info → arpakitlib-1.5.28.dist-info}/WHEEL +0 -0
@@ -6,7 +6,6 @@ import asyncio
|
|
6
6
|
import hashlib
|
7
7
|
import json
|
8
8
|
import logging
|
9
|
-
from asyncio import sleep
|
10
9
|
from datetime import timedelta, datetime, time
|
11
10
|
from typing import Any
|
12
11
|
from urllib.parse import urljoin
|
@@ -19,6 +18,7 @@ from pydantic import ConfigDict, BaseModel
|
|
19
18
|
from arpakitlib.ar_dict_util import combine_dicts
|
20
19
|
from arpakitlib.ar_enumeration import EasyEnumeration
|
21
20
|
from arpakitlib.ar_json_util import safely_transfer_to_json_str
|
21
|
+
from arpakitlib.ar_sleep_util import async_safe_sleep
|
22
22
|
from arpakitlib.ar_type_util import raise_for_type
|
23
23
|
|
24
24
|
_ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
@@ -334,7 +334,7 @@ class ARPAKITScheduleUUSTAPIClient:
|
|
334
334
|
self._logger.warning(f"{tries}/{max_tries} {err} {method} {url}")
|
335
335
|
if tries >= max_tries:
|
336
336
|
raise err
|
337
|
-
await
|
337
|
+
await async_safe_sleep(timedelta(seconds=0.1).total_seconds())
|
338
338
|
continue
|
339
339
|
|
340
340
|
async def healthcheck(self) -> bool:
|
arpakitlib/ar_base_worker.py
CHANGED
@@ -6,7 +6,7 @@ from abc import ABC
|
|
6
6
|
from datetime import timedelta
|
7
7
|
from typing import Any
|
8
8
|
|
9
|
-
from arpakitlib.
|
9
|
+
from arpakitlib.ar_sleep_util import sync_safe_sleep, async_safe_sleep
|
10
10
|
|
11
11
|
_ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
12
12
|
|
@@ -28,12 +28,12 @@ class BaseWorker(ABC):
|
|
28
28
|
def sync_run_on_error(self, exception: BaseException, kwargs: dict[str, Any]):
|
29
29
|
self._logger.exception(exception)
|
30
30
|
|
31
|
-
def
|
32
|
-
self._logger.info(f"
|
31
|
+
def sync_safe_run(self):
|
32
|
+
self._logger.info(f"sync_safe_run")
|
33
33
|
|
34
|
-
self._logger.info("
|
34
|
+
self._logger.info("sync_on_startup starts")
|
35
35
|
self.sync_on_startup()
|
36
|
-
self._logger.info("
|
36
|
+
self._logger.info("sync_on_startup ends")
|
37
37
|
|
38
38
|
while True:
|
39
39
|
|
@@ -44,7 +44,7 @@ class BaseWorker(ABC):
|
|
44
44
|
self._logger.info("sync_run ends")
|
45
45
|
|
46
46
|
if self.timeout_after_run is not None:
|
47
|
-
|
47
|
+
sync_safe_sleep(self.timeout_after_run)
|
48
48
|
|
49
49
|
except BaseException as exception:
|
50
50
|
|
@@ -53,7 +53,7 @@ class BaseWorker(ABC):
|
|
53
53
|
self._logger.info("sync_run_on_error ends")
|
54
54
|
|
55
55
|
if self.timeout_after_err_in_run is not None:
|
56
|
-
|
56
|
+
sync_safe_sleep(self.timeout_after_err_in_run)
|
57
57
|
|
58
58
|
async def async_on_startup(self):
|
59
59
|
pass
|
@@ -78,7 +78,7 @@ class BaseWorker(ABC):
|
|
78
78
|
await self.async_run()
|
79
79
|
|
80
80
|
if self.timeout_after_run is not None:
|
81
|
-
await
|
81
|
+
await async_safe_sleep(self.timeout_after_run)
|
82
82
|
|
83
83
|
except BaseException as exception:
|
84
84
|
|
@@ -87,7 +87,7 @@ class BaseWorker(ABC):
|
|
87
87
|
self._logger.info("async_run_on_error ends")
|
88
88
|
|
89
89
|
if self.timeout_after_err_in_run is not None:
|
90
|
-
await
|
90
|
+
await async_safe_sleep(self.timeout_after_err_in_run)
|
91
91
|
|
92
92
|
|
93
93
|
def __example():
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
import asyncio
|
4
4
|
import logging
|
5
|
-
from asyncio import sleep
|
6
5
|
from datetime import timedelta
|
7
6
|
from urllib.parse import urljoin
|
8
7
|
|
@@ -12,6 +11,7 @@ from pydantic import ConfigDict, BaseModel
|
|
12
11
|
|
13
12
|
from arpakitlib.ar_base64_util import convert_base64_string_to_bytes
|
14
13
|
from arpakitlib.ar_json_util import safely_transfer_to_json_str
|
14
|
+
from arpakitlib.ar_sleep_util import async_safe_sleep
|
15
15
|
|
16
16
|
_ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
17
17
|
|
@@ -72,7 +72,7 @@ class DreamAIAPIClient:
|
|
72
72
|
self._logger.warning(f"{tries}/{max_tries} {err} {method} {url}")
|
73
73
|
if tries >= max_tries:
|
74
74
|
raise err
|
75
|
-
await
|
75
|
+
await async_safe_sleep(timedelta(seconds=0.1).total_seconds())
|
76
76
|
continue
|
77
77
|
|
78
78
|
async def healthcheck(self) -> bool:
|
arpakitlib/ar_fastapi_util.py
CHANGED
@@ -55,14 +55,13 @@ class APIJSONResponse(fastapi.responses.JSONResponse):
|
|
55
55
|
)
|
56
56
|
|
57
57
|
|
58
|
-
class APIErrorCodes(EasyEnumeration):
|
59
|
-
cannot_authorize = "CANNOT_AUTHORIZE"
|
60
|
-
unknown_error = "UNKNOWN_ERROR"
|
61
|
-
error_in_request = "ERROR_IN_REQUEST"
|
62
|
-
not_found = "NOT_FOUND"
|
63
|
-
|
64
|
-
|
65
58
|
class APIErrorSO(BaseAPISO):
|
59
|
+
class APIErrorCodes(EasyEnumeration):
|
60
|
+
cannot_authorize = "CANNOT_AUTHORIZE"
|
61
|
+
unknown_error = "UNKNOWN_ERROR"
|
62
|
+
error_in_request = "ERROR_IN_REQUEST"
|
63
|
+
not_found = "NOT_FOUND"
|
64
|
+
|
66
65
|
has_error: bool = True
|
67
66
|
error_code: str | None = None
|
68
67
|
error_code_specification: str | None = None
|
@@ -75,7 +74,7 @@ class APIException(fastapi.exceptions.HTTPException):
|
|
75
74
|
self,
|
76
75
|
*,
|
77
76
|
status_code: int = starlette.status.HTTP_400_BAD_REQUEST,
|
78
|
-
error_code: str | None = APIErrorCodes.unknown_error,
|
77
|
+
error_code: str | None = APIErrorSO.APIErrorCodes.unknown_error,
|
79
78
|
error_code_specification: str | None = None,
|
80
79
|
error_description: str | None = None,
|
81
80
|
error_data: dict[str, Any] | None = None
|
@@ -113,7 +112,7 @@ def from_exception_to_api_json_response(
|
|
113
112
|
|
114
113
|
easy_api_error_so = APIErrorSO(
|
115
114
|
has_error=True,
|
116
|
-
error_code=APIErrorCodes.unknown_error
|
115
|
+
error_code=APIErrorSO.APIErrorCodes.unknown_error
|
117
116
|
)
|
118
117
|
|
119
118
|
status_code = starlette.status.HTTP_500_INTERNAL_SERVER_ERROR
|
@@ -124,11 +123,11 @@ def from_exception_to_api_json_response(
|
|
124
123
|
elif isinstance(exception, starlette.exceptions.HTTPException):
|
125
124
|
status_code = exception.status_code
|
126
125
|
if status_code in (starlette.status.HTTP_403_FORBIDDEN, starlette.status.HTTP_401_UNAUTHORIZED):
|
127
|
-
easy_api_error_so.error_code = APIErrorCodes.cannot_authorize
|
126
|
+
easy_api_error_so.error_code = APIErrorSO.APIErrorCodes.cannot_authorize
|
128
127
|
elif status_code == starlette.status.HTTP_404_NOT_FOUND:
|
129
|
-
easy_api_error_so.error_code = APIErrorCodes.not_found
|
128
|
+
easy_api_error_so.error_code = APIErrorSO.APIErrorCodes.not_found
|
130
129
|
else:
|
131
|
-
easy_api_error_so.error_code = APIErrorCodes.unknown_error
|
130
|
+
easy_api_error_so.error_code = APIErrorSO.APIErrorCodes.unknown_error
|
132
131
|
if (
|
133
132
|
isinstance(exception.detail, dict)
|
134
133
|
or isinstance(exception.detail, list)
|
@@ -141,12 +140,12 @@ def from_exception_to_api_json_response(
|
|
141
140
|
|
142
141
|
elif isinstance(exception, fastapi.exceptions.RequestValidationError):
|
143
142
|
status_code = starlette.status.HTTP_422_UNPROCESSABLE_ENTITY
|
144
|
-
easy_api_error_so.error_code = APIErrorCodes.error_in_request
|
143
|
+
easy_api_error_so.error_code = APIErrorSO.APIErrorCodes.error_in_request
|
145
144
|
easy_api_error_so.error_data["raw"] = str(exception.errors()) if exception.errors() else {}
|
146
145
|
|
147
146
|
else:
|
148
147
|
status_code = starlette.status.HTTP_500_INTERNAL_SERVER_ERROR
|
149
|
-
easy_api_error_so.error_code = APIErrorCodes.unknown_error
|
148
|
+
easy_api_error_so.error_code = APIErrorSO.APIErrorCodes.unknown_error
|
150
149
|
easy_api_error_so.error_data["raw"] = str(exception)
|
151
150
|
_logger.exception(exception)
|
152
151
|
|
@@ -8,7 +8,7 @@ from datetime import timedelta
|
|
8
8
|
import aiohttp
|
9
9
|
import requests
|
10
10
|
|
11
|
-
from arpakitlib.
|
11
|
+
from arpakitlib.ar_sleep_util import sync_safe_sleep, async_safe_sleep
|
12
12
|
|
13
13
|
_ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
14
14
|
|
@@ -33,7 +33,7 @@ def sync_make_request(*, method: str, url: str, **kwargs) -> requests.Response:
|
|
33
33
|
_logger.warning(f"{tries}/{max_tries} {method} {url} {err}")
|
34
34
|
if tries >= max_tries:
|
35
35
|
raise Exception(err)
|
36
|
-
|
36
|
+
sync_safe_sleep(timedelta(seconds=0.1).total_seconds())
|
37
37
|
continue
|
38
38
|
|
39
39
|
|
@@ -60,7 +60,7 @@ async def async_make_request(*, method: str, url: str, **kwargs) -> aiohttp.Clie
|
|
60
60
|
_logger.warning(f"{tries}/{max_tries} {method} {url} {err}")
|
61
61
|
if tries >= max_tries:
|
62
62
|
raise Exception(err)
|
63
|
-
await
|
63
|
+
await async_safe_sleep(timedelta(seconds=0.1).total_seconds())
|
64
64
|
continue
|
65
65
|
|
66
66
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# from datetime import datetime
|
2
|
+
# from typing import Any
|
3
|
+
#
|
4
|
+
# from sqlalchemy import TIMESTAMP, TEXT
|
5
|
+
# from sqlalchemy.dialects.postgresql import JSONB
|
6
|
+
# from sqlalchemy.orm import Mapped, mapped_column
|
7
|
+
#
|
8
|
+
# from arpakitlib.ar_enumeration import EasyEnumeration
|
9
|
+
# from arpakitlib.ar_sqlalchemy_model_util import SimpleDBM
|
10
|
+
#
|
11
|
+
#
|
12
|
+
# class OperationDBM(SimpleDBM):
|
13
|
+
# __tablename__ = "operation"
|
14
|
+
#
|
15
|
+
# class Statuses(EasyEnumeration):
|
16
|
+
# waiting_for_execution = "waiting_for_execution"
|
17
|
+
# executing = "executing"
|
18
|
+
# executed_without_error = "executed_without_error"
|
19
|
+
# executed_with_error = "executed_with_error"
|
20
|
+
#
|
21
|
+
# class Types(EasyEnumeration):
|
22
|
+
# healthcheck_ = "healthcheck"
|
23
|
+
#
|
24
|
+
# status: Mapped[str] = mapped_column(
|
25
|
+
# TEXT, index=True, insert_default=Statuses.waiting_for_execution, nullable=False
|
26
|
+
# )
|
27
|
+
# type: Mapped[str] = mapped_column(
|
28
|
+
# TEXT, index=True, insert_default=Types.healthcheck_, nullable=False
|
29
|
+
# )
|
30
|
+
# execution_start_dt: Mapped[datetime | None] = mapped_column(TIMESTAMP(timezone=True), nullable=True)
|
31
|
+
# execution_finish_dt: Mapped[datetime | None] = mapped_column(TIMESTAMP(timezone=True), nullable=True)
|
32
|
+
# input_data: Mapped[dict[str, Any]] = mapped_column(
|
33
|
+
# JSONB,
|
34
|
+
# insert_default={},
|
35
|
+
# server_default="{}",
|
36
|
+
# nullable=False
|
37
|
+
# )
|
38
|
+
# output_data: Mapped[dict[str, Any]] = mapped_column(JSONB, insert_default={}, server_default="{}", nullable=False)
|
39
|
+
# error_data: Mapped[dict[str, Any]] = mapped_column(JSONB, insert_default={}, server_default="{}", nullable=False)
|
40
|
+
#
|
41
|
+
# def raise_if_executed_with_error(self):
|
42
|
+
# if self.status == self.Statuses.executed_with_error:
|
43
|
+
# raise Exception(
|
44
|
+
# f"Operation (id={self.id}, type={self.type}) executed with error, error_data={self.error_data}"
|
45
|
+
# )
|
46
|
+
#
|
47
|
+
# def raise_if_error_data(self):
|
48
|
+
# if self.status == self.Statuses.executed_with_error:
|
49
|
+
# raise Exception(
|
50
|
+
# f"Operation (id={self.id}, type={self.type}) has error_data, error_data={self.error_data}"
|
51
|
+
# )
|
@@ -12,6 +12,7 @@ from aiohttp import ClientTimeout
|
|
12
12
|
from aiohttp_socks import ProxyConnector
|
13
13
|
|
14
14
|
from arpakitlib.ar_dict_util import combine_dicts
|
15
|
+
from arpakitlib.ar_sleep_util import async_safe_sleep
|
15
16
|
|
16
17
|
_ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
17
18
|
|
@@ -103,7 +104,7 @@ class ScheduleUUSTAPIClient:
|
|
103
104
|
self._logger.warning(f"{tries}/{max_tries} {err} GET {url} {params} proxy={self.api_proxy_url}")
|
104
105
|
if tries >= max_tries:
|
105
106
|
raise err
|
106
|
-
await
|
107
|
+
await async_safe_sleep(timedelta(seconds=1).total_seconds())
|
107
108
|
self._logger.warning(f"{tries}/{max_tries} AGAIN GET {url} {params} proxy={self.api_proxy_url}")
|
108
109
|
continue
|
109
110
|
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# arpakit
|
2
|
+
|
3
|
+
import asyncio
|
4
|
+
import logging
|
5
|
+
import math
|
6
|
+
from time import sleep
|
7
|
+
|
8
|
+
from asyncpg.pgproto.pgproto import timedelta
|
9
|
+
|
10
|
+
_ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
11
|
+
|
12
|
+
_logger = logging.getLogger(__name__)
|
13
|
+
|
14
|
+
|
15
|
+
def sync_safe_sleep(n: timedelta | float | int):
|
16
|
+
_logger.info(f"sync_safe_sleep ({n}) starts")
|
17
|
+
|
18
|
+
if isinstance(n, timedelta):
|
19
|
+
n = n.total_seconds()
|
20
|
+
elif isinstance(n, int):
|
21
|
+
n = float(n)
|
22
|
+
elif isinstance(n, float):
|
23
|
+
n = n
|
24
|
+
else:
|
25
|
+
raise TypeError(f"n={n}, type={type(n)}, n: timedelta | float | int")
|
26
|
+
|
27
|
+
n: float = n
|
28
|
+
|
29
|
+
frac, int_part = math.modf(n)
|
30
|
+
for i in range(int(int_part)):
|
31
|
+
sleep(1)
|
32
|
+
sleep(frac)
|
33
|
+
|
34
|
+
_logger.info(f"sync_safe_sleep ({n}) ends")
|
35
|
+
|
36
|
+
|
37
|
+
async def async_safe_sleep(n: timedelta | float | int):
|
38
|
+
_logger.info(f"async_safe_sleep ({n}) starts")
|
39
|
+
|
40
|
+
if isinstance(n, timedelta):
|
41
|
+
n = n.total_seconds()
|
42
|
+
elif isinstance(n, int):
|
43
|
+
n = float(n)
|
44
|
+
elif isinstance(n, float):
|
45
|
+
n = n
|
46
|
+
else:
|
47
|
+
raise TypeError(f"n={n}, type={type(n)}, n: timedelta | float | int")
|
48
|
+
|
49
|
+
n: float = n
|
50
|
+
|
51
|
+
_logger.info(f"sleep_time ({n}) starts")
|
52
|
+
await asyncio.sleep(n)
|
53
|
+
_logger.info(f"sleep_time ({n}) ends")
|
54
|
+
|
55
|
+
_logger.info(f"async_safe_sleep ({n}) ends")
|
56
|
+
|
57
|
+
|
58
|
+
def __example():
|
59
|
+
pass
|
60
|
+
|
61
|
+
|
62
|
+
async def __async_example():
|
63
|
+
pass
|
64
|
+
|
65
|
+
|
66
|
+
if __name__ == '__main__':
|
67
|
+
__example()
|
68
|
+
asyncio.run(__async_example())
|
@@ -13,7 +13,7 @@ import requests
|
|
13
13
|
|
14
14
|
from arpakitlib.ar_dict_util import combine_dicts
|
15
15
|
from arpakitlib.ar_enumeration import EasyEnumeration
|
16
|
-
from arpakitlib.
|
16
|
+
from arpakitlib.ar_sleep_util import sync_safe_sleep, async_safe_sleep
|
17
17
|
from arpakitlib.ar_type_util import raise_for_type
|
18
18
|
|
19
19
|
_ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
@@ -63,7 +63,7 @@ class YookassaAPIClient:
|
|
63
63
|
self._logger.warning(f"{tries}/{max_tries} {err} {method} {url}")
|
64
64
|
if tries >= max_tries:
|
65
65
|
raise YookassaAPIException(err)
|
66
|
-
|
66
|
+
sync_safe_sleep(timedelta(seconds=0.1).total_seconds())
|
67
67
|
continue
|
68
68
|
|
69
69
|
async def _async_make_request(self, method: str, url: str, **kwargs) -> aiohttp.ClientResponse:
|
@@ -90,7 +90,7 @@ class YookassaAPIClient:
|
|
90
90
|
self._logger.warning(f"{tries}/{max_tries} {err} {method} {url}")
|
91
91
|
if tries >= max_tries:
|
92
92
|
raise YookassaAPIException(err)
|
93
|
-
await
|
93
|
+
await async_safe_sleep(timedelta(seconds=0.1).total_seconds())
|
94
94
|
continue
|
95
95
|
|
96
96
|
def sync_create_payment(
|
@@ -6,14 +6,14 @@ arpakitlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
arpakitlib/ar_additional_model_util.py,sha256=Eq7pvVUgO2L3gYBocm-pP9TrztTb8VNCp7LdRMml-F8,237
|
7
7
|
arpakitlib/ar_aiogram_util.py,sha256=IA48PRMIJrPLMhFA0Eb2vQpLcqm98o9tKfC3pDy8qsI,12022
|
8
8
|
arpakitlib/ar_arpakit_lib_module_util.py,sha256=YzobxRG8-QJ1L5r_8wBdL668CwXoQRIM1Cpec1o2WBc,5447
|
9
|
-
arpakitlib/ar_arpakit_schedule_uust_api_client.py,sha256=
|
9
|
+
arpakitlib/ar_arpakit_schedule_uust_api_client.py,sha256=V8n5XxkrsZo7ASNAepD0mqgRtI7qIleCDgk7WAmdLW8,18244
|
10
10
|
arpakitlib/ar_arpakitlib_info.py,sha256=cvgrLnEznmYkCAg1adbY46ATjD6GJd-Yk8PTgOPjpKM,248
|
11
11
|
arpakitlib/ar_base64_util.py,sha256=aZkg2cZTuAaP2IWeG_LXJ6RO7qhyskVwec-Lks0iM-k,676
|
12
|
-
arpakitlib/ar_base_worker.py,sha256
|
12
|
+
arpakitlib/ar_base_worker.py,sha256=ZeSXF6EhhlWvZk4mDaDkPmlpTm7o47QW-EhwTmdCbt8,2888
|
13
13
|
arpakitlib/ar_cache_file.py,sha256=m73_vU6bMjXsIurSPO9VCLcHsiHk8ITFS0LNjfI_8Uw,3471
|
14
14
|
arpakitlib/ar_datetime_util.py,sha256=Xe1NiT9oPQzNSG7RVRkhukhbg4i-hhS5ImmV7sPUc8o,971
|
15
15
|
arpakitlib/ar_dict_util.py,sha256=cF5LQJ6tLqyGoEXfDljMDZrikeZoWPw7CgINHIFGvXM,419
|
16
|
-
arpakitlib/ar_dream_ai_api_client.py,sha256=
|
16
|
+
arpakitlib/ar_dream_ai_api_client.py,sha256=hDPL9wbG4MjIuhn2ed6qepueogANIkt-NddhhiPUv0Y,4029
|
17
17
|
arpakitlib/ar_easy_sqlalchemy_util.py,sha256=HuKRBD4XoxeZ5tpXlDTol5Y6AOzuCBluJQHfyRjlRqs,3224
|
18
18
|
arpakitlib/ar_encrypt_and_decrypt_util.py,sha256=GhWnp7HHkbhwFVVCzO1H07m-5gryr4yjWsXjOaNQm1Y,520
|
19
19
|
arpakitlib/ar_enumeration.py,sha256=6KUJYOabHDPLfdigBVN0ZI4ZOUJh8TkL0g4o92Hke2I,2254
|
@@ -36,11 +36,11 @@ arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css,sha256=jzPZlgJTFwSdSphk9C
|
|
36
36
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css.map,sha256=5wq8eXMLU6Zxb45orZPL1zAsBFJReFw6GjYqGpUX3hg,262650
|
37
37
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js,sha256=ffrLZHHEQ_g84A-ul3yWa10Kk09waOAxHcQXPuZuavg,339292
|
38
38
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js.map,sha256=9UhIW7MqCOZPAz1Sl1IKfZUuhWU0p-LJqrnjjJD9Xhc,1159454
|
39
|
-
arpakitlib/ar_fastapi_util.py,sha256=
|
39
|
+
arpakitlib/ar_fastapi_util.py,sha256=OS3_zeo7it_Yhl0M8c6Uuhn1hjsjlYnAzeK_RGcQekk,9751
|
40
40
|
arpakitlib/ar_file_storage_in_dir.py,sha256=D3e3rGuHoI6xqAA5mVvEpVVpOWY1jyjNsjj2UhyHRbE,3674
|
41
41
|
arpakitlib/ar_generate_env_example.py,sha256=WseNlk_So6mTVQ2amMuigWYV4ZVmd940POvXtodoYj0,325
|
42
42
|
arpakitlib/ar_hash_util.py,sha256=Iqy6KBAOLBQMFLWv676boI5sV7atT2B-fb7aCdHOmIQ,340
|
43
|
-
arpakitlib/ar_http_request_util.py,sha256=
|
43
|
+
arpakitlib/ar_http_request_util.py,sha256=nDxJFsljLFurMFEFhhTlBCyEMHBNv9XaTZYhqZFjvfI,2104
|
44
44
|
arpakitlib/ar_ip_util.py,sha256=aEAa1Hvobh9DWX7cmBAPLqnXSTiKe2hRk-WJaiKMaI8,1009
|
45
45
|
arpakitlib/ar_json_db.py,sha256=CEyhIU4WuNmX5mqwBVYxUKSdpFelXvWmf_tJ1fuxMSE,7187
|
46
46
|
arpakitlib/ar_json_util.py,sha256=S8CskZ3uoYuJGCy1GhQ8Ikhn-fxXk-9JpLUbBvXADqI,833
|
@@ -51,19 +51,20 @@ arpakitlib/ar_logging_util.py,sha256=c5wX2FLqCzb4aLckLVhIJ7go52rJQ4GN9dIkJ6KMc3o
|
|
51
51
|
arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
|
52
52
|
arpakitlib/ar_need_type_util.py,sha256=qCRSWlSgx-3yU0NRHZDQ5lCOmuZKcz2Na3py9nr6hJM,1618
|
53
53
|
arpakitlib/ar_openai_util.py,sha256=d5Aj1O2yo_zYLZCLeOLvuveYYxA2jGOqhMs1oUbuVk8,1210
|
54
|
+
arpakitlib/ar_operation_execution_util.py,sha256=msoUrwgBd9HTPsxcuC2jtHgJyQubBNJpvp4RYRTaxko,2139
|
54
55
|
arpakitlib/ar_parse_command.py,sha256=qpr2OwG3Bf7DFiL9S3iWgtbvtE80RSC35E5zFJvjG1I,2714
|
55
56
|
arpakitlib/ar_postgresql_util.py,sha256=SAHEmAyMkZe516uk2gS830v_Wn2kRUZUYNcTNwmgXJk,1160
|
56
57
|
arpakitlib/ar_run_cmd.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
|
57
|
-
arpakitlib/
|
58
|
-
arpakitlib/
|
59
|
-
arpakitlib/ar_sqlalchemy_model_util.py,sha256=
|
58
|
+
arpakitlib/ar_schedule_uust_api_client.py,sha256=rr80X15Cg4lV5oeqvbHIrG8t09qkzbKrY6v7gK7zT70,6851
|
59
|
+
arpakitlib/ar_sleep_util.py,sha256=9ZN4Qo4eZ_q3hjM7vNBQjFRcH-9-sqv3QLSjnxVJE90,1405
|
60
|
+
arpakitlib/ar_sqlalchemy_model_util.py,sha256=3zscvaloi9XY1NR70rJ4-jJlFUIqhmTbQ9wdvK-Yjf8,1379
|
60
61
|
arpakitlib/ar_ssh_runner.py,sha256=jlnss4V4pziBN1rBzoK_lDiWm6nMOqGXfa6NFJSKH-Y,6796
|
61
62
|
arpakitlib/ar_str_util.py,sha256=xSEzmsDvRiZVaxyqFFjcgzpphktCbXg2FHcvsd1DYpA,1885
|
62
63
|
arpakitlib/ar_type_util.py,sha256=-h-SCsVl11eVo1u4hy2Asn0IfD5TIxmX3Ndug4AvnPE,1761
|
63
|
-
arpakitlib/ar_yookassa_api_client.py,sha256=
|
64
|
+
arpakitlib/ar_yookassa_api_client.py,sha256=BwsTygaXf35AACVBl_09uYlSD_t-U1OOzbj58OOFT4Q,6480
|
64
65
|
arpakitlib/ar_zabbix_util.py,sha256=MTQbmS0QpNCKNOGONNQHf6j7KTZsKGlIbd5rCH0R0WI,6313
|
65
|
-
arpakitlib-1.5.
|
66
|
-
arpakitlib-1.5.
|
67
|
-
arpakitlib-1.5.
|
68
|
-
arpakitlib-1.5.
|
69
|
-
arpakitlib-1.5.
|
66
|
+
arpakitlib-1.5.28.dist-info/LICENSE,sha256=1jqWIkbnMxDfs_i0SXP5qbV6PHjBr1g8506oW7uPjfg,11347
|
67
|
+
arpakitlib-1.5.28.dist-info/METADATA,sha256=GjSiqfOwYghOPXb6svQMetAoHSukmBD47BFWRAezyew,2323
|
68
|
+
arpakitlib-1.5.28.dist-info/NOTICE,sha256=wHwmiq3wExfFfgMsE5U5TOBP9_l72ocIG82KurEels0,43
|
69
|
+
arpakitlib-1.5.28.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
70
|
+
arpakitlib-1.5.28.dist-info/RECORD,,
|
arpakitlib/ar_safe_sleep.py
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# arpakit
|
2
|
-
|
3
|
-
import logging
|
4
|
-
import math
|
5
|
-
from time import sleep
|
6
|
-
|
7
|
-
_ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
8
|
-
|
9
|
-
_logger = logging.getLogger(__name__)
|
10
|
-
|
11
|
-
|
12
|
-
def safe_sleep(sleep_time: float | int):
|
13
|
-
_logger.info(f"sleep_time={sleep_time}")
|
14
|
-
frac, int_part = math.modf(sleep_time)
|
15
|
-
for i in range(int(int_part)):
|
16
|
-
sleep(1)
|
17
|
-
sleep(frac)
|
18
|
-
|
19
|
-
|
20
|
-
def __example():
|
21
|
-
pass
|
22
|
-
|
23
|
-
|
24
|
-
if __name__ == '__main__':
|
25
|
-
__example()
|
File without changes
|
File without changes
|
File without changes
|