arpakitlib 1.7.98__py3-none-any.whl → 1.7.99__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.
@@ -13,7 +13,7 @@ from uuid import uuid4
13
13
  from arpakitlib.ar_datetime_util import now_utc_dt
14
14
  from arpakitlib.ar_enumeration_util import Enumeration
15
15
  from arpakitlib.ar_func_util import is_async_function, is_sync_function
16
- from arpakitlib.ar_sleep_util import sync_safe_sleep
16
+ from arpakitlib.ar_sleep_util import sync_safe_sleep, async_safe_sleep
17
17
 
18
18
  _ARPAKIT_LIB_MODULE_VERSION = "3.0"
19
19
 
@@ -57,7 +57,7 @@ class BaseWorker(ABC):
57
57
  def sync_run(self):
58
58
  self._logger.info(f"hello world, im {self.worker_fullname}")
59
59
 
60
- def sync_run_on_error(self, exception: BaseException, **kwargs):
60
+ def sync_on_error(self, exception: BaseException, **kwargs):
61
61
  pass
62
62
 
63
63
  def sync_safe_run(self):
@@ -73,9 +73,9 @@ class BaseWorker(ABC):
73
73
  except BaseException as exception:
74
74
  self._logger.error("error in sync_run", exc_info=exception)
75
75
  try:
76
- self.sync_run_on_error(exception=exception)
76
+ self.sync_on_error(exception=exception)
77
77
  except BaseException as exception_:
78
- self._logger.error("error in sync_run_on_error", exc_info=exception_)
78
+ self._logger.error("error in sync_on_error", exc_info=exception_)
79
79
  raise exception_
80
80
  sync_safe_sleep(self.timeout_after_err_in_run)
81
81
  sync_safe_sleep(self.timeout_after_run)
@@ -95,7 +95,7 @@ class BaseWorker(ABC):
95
95
  async def async_run(self):
96
96
  self._logger.info(f"hello world, im {self.worker_fullname}")
97
97
 
98
- async def async_run_on_error(self, exception: BaseException, **kwargs):
98
+ async def async_on_error(self, exception: BaseException, **kwargs):
99
99
  pass
100
100
 
101
101
  async def async_safe_run(self):
@@ -111,12 +111,12 @@ class BaseWorker(ABC):
111
111
  except BaseException as exception:
112
112
  self._logger.error("error in async_run", exc_info=exception)
113
113
  try:
114
- await self.async_run_on_error(exception=exception)
114
+ await self.async_on_error(exception=exception)
115
115
  except BaseException as exception_:
116
- self._logger.error("error in async_run_on_error", exc_info=exception_)
116
+ self._logger.error("error in async_on_error", exc_info=exception_)
117
117
  raise exception_
118
- sync_safe_sleep(self.timeout_after_err_in_run)
119
- sync_safe_sleep(self.timeout_after_run)
118
+ await async_safe_sleep(self.timeout_after_err_in_run)
119
+ await async_safe_sleep(self.timeout_after_run)
120
120
 
121
121
 
122
122
  class SafeRunInBackgroundModes(Enumeration):
@@ -345,9 +345,6 @@ class OperationExecutorWorker(BaseWorker):
345
345
  return
346
346
  self.sync_execute_operation(operation_dbm=operation_dbm, session=session)
347
347
 
348
- def sync_run_on_error(self, exception: BaseException, **kwargs):
349
- pass
350
-
351
348
  async def async_on_startup(self):
352
349
  self.sqlalchemy_db.init()
353
350
  await self.async_run_startup_funcs()
@@ -368,9 +365,6 @@ class OperationExecutorWorker(BaseWorker):
368
365
  return
369
366
  await self.async_execute_operation(operation_dbm=operation_dbm, session=session)
370
367
 
371
- async def async_run_on_error(self, exception: BaseException, **kwargs):
372
- pass
373
-
374
368
 
375
369
  class ScheduledOperation(BaseModel):
376
370
  model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True, from_attributes=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arpakitlib
3
- Version: 1.7.98
3
+ Version: 1.7.99
4
4
  Summary: arpakitlib
5
5
  Home-page: https://github.com/ARPAKIT-Company/arpakitlib
6
6
  License: Apache-2.0
@@ -121,7 +121,7 @@ arpakitlib/ar_arpakit_project_template_util.py,sha256=AswzQvvb-zfUyrcP4EP0K756YL
121
121
  arpakitlib/ar_arpakit_schedule_uust_api_client_util.py,sha256=jGbP6egs2yhgfheyqhM0J-SeM2qp2YrW7dV-u9djv4Q,19223
122
122
  arpakitlib/ar_arpakitlib_cli_util.py,sha256=8lhEDxnwMSRX2PGV2xQtQru1AYKSA92SVolol5u7iBk,3154
123
123
  arpakitlib/ar_base64_util.py,sha256=aZkg2cZTuAaP2IWeG_LXJ6RO7qhyskVwec-Lks0iM-k,676
124
- arpakitlib/ar_base_worker_util.py,sha256=T53HIx1azgal4ZmBR1afXqQ3_zex35NIAYPHNchhxfs,5666
124
+ arpakitlib/ar_base_worker_util.py,sha256=Qm_C7PFH5W-LPu1AGX1zp29zbqZ04i71Su1U-eeQBkA,5674
125
125
  arpakitlib/ar_cache_file_util.py,sha256=Fo2pH-Zqm966KWFBHG_pbiySGZvhIFCYqy7k1weRfJ0,3476
126
126
  arpakitlib/ar_datetime_util.py,sha256=Xe1NiT9oPQzNSG7RVRkhukhbg4i-hhS5ImmV7sPUc8o,971
127
127
  arpakitlib/ar_dict_util.py,sha256=cF5LQJ6tLqyGoEXfDljMDZrikeZoWPw7CgINHIFGvXM,419
@@ -165,7 +165,7 @@ arpakitlib/ar_logging_util.py,sha256=mx3H6CzX9dsh29ruFmYnva8lL6mwvdBXmeHH9E2tvu8
165
165
  arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
166
166
  arpakitlib/ar_need_type_util.py,sha256=GETiREPMEYhch-yU6T--Bdawlbb04Jp1Qy7cOsUlIeA,2228
167
167
  arpakitlib/ar_openai_api_client_util.py,sha256=_XmlApvHFMSyjvZydPa_kASIt9LsFrZmSC7YEzIG8Bg,1806
168
- arpakitlib/ar_operation_execution_util.py,sha256=bREu2IpBzbITEioS6SaL9bhvUPlYCuVgclTVEZCGx-Q,17696
168
+ arpakitlib/ar_operation_execution_util.py,sha256=Mu8U6h6WnPPmiNsByT788jroUNQxKHUK4UUTiRpRYYQ,17523
169
169
  arpakitlib/ar_parse_command.py,sha256=-s61xcATIsfw1eV_iD3xi-grsitbGzSDoAFc5V0OFy4,3447
170
170
  arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
171
171
  arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
@@ -179,9 +179,9 @@ arpakitlib/ar_str_util.py,sha256=tFoGSDYoGpfdVHWor5Li9pEOFmDFlHkX-Z8iOy1LK7Y,353
179
179
  arpakitlib/ar_type_util.py,sha256=s0NsTM7mV3HuwyRwyYLdNn7Ep2HbyI4FIr-dd8x0lfI,3734
180
180
  arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
181
181
  arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
182
- arpakitlib-1.7.98.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
183
- arpakitlib-1.7.98.dist-info/METADATA,sha256=zkxKjwhBYByQZXxTdQlu96XUSDy0C0Q8Zcy8nowTSwI,2824
184
- arpakitlib-1.7.98.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
185
- arpakitlib-1.7.98.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
186
- arpakitlib-1.7.98.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
187
- arpakitlib-1.7.98.dist-info/RECORD,,
182
+ arpakitlib-1.7.99.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
183
+ arpakitlib-1.7.99.dist-info/METADATA,sha256=V4nmG5JewLbuET2gPAW9fGRJeDjhdIhA8AKrXMBeOE8,2824
184
+ arpakitlib-1.7.99.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
185
+ arpakitlib-1.7.99.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
186
+ arpakitlib-1.7.99.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
187
+ arpakitlib-1.7.99.dist-info/RECORD,,