arpakitlib 1.8.269__py3-none-any.whl → 1.8.271__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.
@@ -26,6 +26,7 @@ class BaseWorker(ABC):
26
26
  startup_funcs: list[Any] | None = None,
27
27
  worker_name: str | None = None,
28
28
  data: dict[str, Any] | None = None,
29
+ timeout_before_safe_run: timedelta | None= None,
29
30
  **kwargs
30
31
  ):
31
32
  self.timeout_after_run = timeout_after_run
@@ -44,6 +45,8 @@ class BaseWorker(ABC):
44
45
  data = {}
45
46
  self.data = data
46
47
 
48
+ self.timeout_before_safe_run = timeout_before_safe_run
49
+
47
50
  self._logger = logging.getLogger(self.worker_fullname)
48
51
 
49
52
  @property
@@ -75,10 +78,10 @@ class BaseWorker(ABC):
75
78
  def sync_on_error(self, exception: Exception, **kwargs):
76
79
  pass
77
80
 
78
- def sync_safe_run(self, *, timeout_before_run: timedelta | None = None):
81
+ def sync_safe_run(self):
79
82
  self._logger.info("start")
80
- if timeout_before_run is not None:
81
- sync_safe_sleep(timeout_before_run)
83
+ if self.timeout_before_safe_run is not None:
84
+ sync_safe_sleep(self.timeout_before_safe_run)
82
85
  try:
83
86
  self.sync_on_startup()
84
87
  except Exception as exception:
@@ -119,10 +122,10 @@ class BaseWorker(ABC):
119
122
  async def async_on_error(self, exception: Exception, **kwargs):
120
123
  pass
121
124
 
122
- async def async_safe_run(self, *, timeout_before_run: timedelta | None = None):
125
+ async def async_safe_run(self):
123
126
  self._logger.info("start async_safe_run")
124
- if timeout_before_run is not None:
125
- await async_safe_sleep(timeout_before_run)
127
+ if self.timeout_before_safe_run is not None:
128
+ await async_safe_sleep(self.timeout_before_safe_run)
126
129
  try:
127
130
  await self.async_on_startup()
128
131
  except Exception as exception:
@@ -309,6 +309,10 @@ class SQLAlchemyDb:
309
309
  from arpakitlib.ar_sqlalchemy_drop_check_constraints import drop_sqlalchemy_check_constraints
310
310
  drop_sqlalchemy_check_constraints(base_=self.base_dbm, engine=self.engine)
311
311
 
312
+ def drop_and_ensure_check_constraints(self):
313
+ self.drop_check_constraints()
314
+ self.ensure_check_constraints()
315
+
312
316
  def init(self, ensure_check_constraints: bool = True):
313
317
  self.base_dbm.metadata.create_all(bind=self.engine, checkfirst=True)
314
318
  if ensure_check_constraints:
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: arpakitlib
3
- Version: 1.8.269
3
+ Version: 1.8.271
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
+ License-File: LICENSE
6
7
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
7
8
  Author: arpakit_company
8
9
  Author-email: support@arpakit.com
@@ -52,6 +53,7 @@ Requires-Dist: pytelegrambotapi (>=4.27.0,<5.0.0)
52
53
  Requires-Dist: pytz (>=2024.2,<2025.0)
53
54
  Requires-Dist: pyzabbix (>=1.3.1,<2.0.0)
54
55
  Requires-Dist: qrcode (>=8.2,<9.0)
56
+ Requires-Dist: rapidfuzz (>=3.14.1,<4.0.0)
55
57
  Requires-Dist: requests-ntlm (>=1.3.0,<2.0.0)
56
58
  Requires-Dist: requests[socks] (>=2.32.3,<3.0.0)
57
59
  Requires-Dist: scipy (>=1.15.1,<2.0.0)
@@ -384,7 +384,7 @@ arpakitlib/ar_arpakit_schedule_uust_api_client_util.py,sha256=MRPaF31CRhYA45ldPn
384
384
  arpakitlib/ar_arpakit_schedule_uust_site_util.py,sha256=8wLct9Gd4MWkXzB6nSmETAwTPLw8lfpWgx0LoWSAOvg,1643
385
385
  arpakitlib/ar_arpakitlib_cli_util.py,sha256=RJGcfEZ_q74FJ4tqdXvt7xQpShTszOvKu1mbp3D8qzw,2599
386
386
  arpakitlib/ar_base64_util.py,sha256=udSSpeXMZx0JgQknl4hQgZ8kr1Ps_aQOloIXu4T9dMQ,1286
387
- arpakitlib/ar_base_worker_util.py,sha256=QXrk_bnxgxtbmz8YhfShxuLMMJEz2HK2KZpYeFcRm1I,6267
387
+ arpakitlib/ar_base_worker_util.py,sha256=4XN29vkju1OBmvZj1MVjxGXVWQzcs9Sdd90JBj1QoFg,6336
388
388
  arpakitlib/ar_blank_util.py,sha256=qFUdY8usL_pRYamz8Rw1fW3fzNIgrLmpdYP8q-_PQvw,2281
389
389
  arpakitlib/ar_cache_file_util.py,sha256=Fo2pH-Zqm966KWFBHG_pbiySGZvhIFCYqy7k1weRfJ0,3476
390
390
  arpakitlib/ar_class_util.py,sha256=i76pQW_7k_S2m_DlQh6xNjtggv9Col3WSx9W_bwk98E,722
@@ -427,12 +427,12 @@ arpakitlib/ar_settings_util.py,sha256=Y5wi_cmsjDjfJpM0VJHjbo0NoVPKfypKaD1USowwDt
427
427
  arpakitlib/ar_sleep_util.py,sha256=ggaj7ML6QK_ADsHMcyu6GUmUpQ_9B9n-SKYH17h-9lM,1045
428
428
  arpakitlib/ar_sqladmin_util.py,sha256=SEoaowAPF3lhxPsNjwmOymNJ55Ty9rmzvsDm7gD5Ceo,861
429
429
  arpakitlib/ar_sqlalchemy_drop_check_constraints.py,sha256=XEqnMrIwSYasW_UOJ8xU-JhsVrcYeyehalFuSvmJMak,3518
430
- arpakitlib/ar_sqlalchemy_util.py,sha256=EMMaoVerrDaFXCCwH2BbbpaVr_oKp4nDlbnoJRJg_84,16404
430
+ arpakitlib/ar_sqlalchemy_util.py,sha256=nUDCxhu0l8P0eBCdLyXej3_yLvBlB3LrGhMWzAekm5E,16532
431
431
  arpakitlib/ar_str_util.py,sha256=2lGpnXDf2h1cBZpVf5i1tX_HCv5iBd6IGnrCw4QWWlY,4350
432
432
  arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
433
433
  arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
434
- arpakitlib-1.8.269.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
435
- arpakitlib-1.8.269.dist-info/METADATA,sha256=bA31Hw4OoYrLzkLSB8hVlkHmS77vA_TS00PKwkJe28g,3919
436
- arpakitlib-1.8.269.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
437
- arpakitlib-1.8.269.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
438
- arpakitlib-1.8.269.dist-info/RECORD,,
434
+ arpakitlib-1.8.271.dist-info/METADATA,sha256=T3IeDAMXhTrbavC0Wq-9JXV9FHApfFmp1v15DqIc-lw,3984
435
+ arpakitlib-1.8.271.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
436
+ arpakitlib-1.8.271.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
437
+ arpakitlib-1.8.271.dist-info/licenses/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
438
+ arpakitlib-1.8.271.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any