arpakitlib 1.7.33__py3-none-any.whl → 1.7.35__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.
@@ -38,21 +38,22 @@ def create_api_app() -> FastAPI:
38
38
  async_funcs_after_response=[]
39
39
  )
40
40
 
41
- startup_api_events = [
42
- InitFileStoragesInDir(
43
- file_storages_in_dir=[
44
- get_cached_media_file_storage_in_dir() if settings.media_dirpath is not None else None,
45
- get_cached_cache_file_storage_in_dir() if settings.cache_dirpath is not None else None,
46
- get_cached_dump_file_storage_in_dir() if settings.dump_dirpath is not None else None
47
- ]
48
- ),
49
- StartupAPIEvent(transmitted_api_data=transmitted_api_data),
50
- ]
41
+ startup_api_events = []
42
+
43
+ startup_api_events.append(InitFileStoragesInDir(
44
+ file_storages_in_dir=[
45
+ get_cached_media_file_storage_in_dir() if settings.media_dirpath is not None else None,
46
+ get_cached_cache_file_storage_in_dir() if settings.cache_dirpath is not None else None,
47
+ get_cached_dump_file_storage_in_dir() if settings.dump_dirpath is not None else None
48
+ ]
49
+ ))
51
50
 
52
51
  if settings.api_init_sql_db_at_start:
53
52
  raise_for_type(sqlalchemy_db, SQLAlchemyDB)
54
53
  startup_api_events.append(InitSqlalchemyDBStartupAPIEvent(sqlalchemy_db=sqlalchemy_db))
55
54
 
55
+ startup_api_events.append(StartupAPIEvent(transmitted_api_data=transmitted_api_data))
56
+
56
57
  if settings.api_start_execute_operation_worker:
57
58
  raise_for_type(sqlalchemy_db, SQLAlchemyDB)
58
59
  startup_api_events.append(
@@ -82,9 +83,9 @@ def create_api_app() -> FastAPI:
82
83
  )
83
84
  )
84
85
 
85
- shutdown_api_events = [
86
- ShutdownAPIEvent(transmitted_api_data=transmitted_api_data)
87
- ]
86
+ shutdown_api_events = []
87
+
88
+ startup_api_events.append(ShutdownAPIEvent(transmitted_api_data=transmitted_api_data))
88
89
 
89
90
  api_app = create_fastapi_app(
90
91
  title=settings.api_title.strip(),
@@ -1,10 +1,6 @@
1
- import logging
2
-
3
1
  from arpakitlib.ar_fastapi_util import BaseStartupAPIEvent, BaseShutdownAPIEvent
4
2
  from src.api.transmitted_api_data import TransmittedAPIData
5
3
 
6
- _logger = logging.getLogger(__name__)
7
-
8
4
 
9
5
  class StartupAPIEvent(BaseStartupAPIEvent):
10
6
  def __init__(self, transmitted_api_data: TransmittedAPIData):
@@ -1,13 +1,13 @@
1
1
  from datetime import timedelta
2
2
 
3
- from arpakitlib.ar_operation_execution_util import ScheduledOperation, every_timedelta
3
+ from arpakitlib.ar_operation_execution_util import ScheduledOperation, is_time_func_every_timedelta
4
4
  from arpakitlib.ar_sqlalchemy_model_util import BaseOperationTypes
5
5
 
6
6
  ALL_SCHEDULED_OPERATIONS = []
7
7
 
8
- operation_healthcheck = ScheduledOperation(
8
+ healthcheck_operation = ScheduledOperation(
9
9
  type=BaseOperationTypes.healthcheck_,
10
10
  input_data={},
11
- is_time_func=every_timedelta(td=timedelta(seconds=5))
11
+ is_time_func=is_time_func_every_timedelta(td=timedelta(seconds=5))
12
12
  )
13
- ALL_SCHEDULED_OPERATIONS.append(operation_healthcheck)
13
+ ALL_SCHEDULED_OPERATIONS.append(healthcheck_operation)
@@ -333,10 +333,10 @@ class CreateScheduledOperationWorker(BaseWorker):
333
333
  session.refresh(operation_dbm)
334
334
 
335
335
 
336
- def every_timedelta(*, td: timedelta) -> Callable:
336
+ def is_time_func_every_timedelta(*, td: timedelta) -> Callable:
337
337
  last_now_utc_dt = now_utc_dt()
338
338
 
339
- def check_time() -> bool:
339
+ def func() -> bool:
340
340
  nonlocal last_now_utc_dt
341
341
  now_utc_dt_ = now_utc_dt()
342
342
  if (now_utc_dt_ - last_now_utc_dt) >= td:
@@ -344,7 +344,7 @@ def every_timedelta(*, td: timedelta) -> Callable:
344
344
  return True
345
345
  return False
346
346
 
347
- return check_time
347
+ return func
348
348
 
349
349
 
350
350
  def __example():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arpakitlib
3
- Version: 1.7.33
3
+ Version: 1.7.35
4
4
  Summary: arpakitlib
5
5
  Home-page: https://github.com/ARPAKIT-Company/arpakitlib
6
6
  License: Apache-2.0
@@ -9,8 +9,6 @@ arpakitlib/_arpakit_project_template/README.md,sha256=EEoHPZrJQtLS3fKD3JvoPhkGhj
9
9
  arpakitlib/_arpakit_project_template/example.env,sha256=9JQcdFX1ChuOZ1WVIJj89xg71xDnb-TRi8LYGje9TDM,232
10
10
  arpakitlib/_arpakit_project_template/example_pyproject.toml,sha256=wLzoszIWqIC8qwgJD7FH_2UzKVh4PB7gi030zO6aYbA,485
11
11
  arpakitlib/_arpakit_project_template/manage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- arpakitlib/_arpakit_project_template/manage/api_start_for_dev_with_reload.py,sha256=xg2SFemhe8KmmoYvaG8zkFZyonzxdxcHuugjS3i0q0I,151
13
- arpakitlib/_arpakit_project_template/manage/api_start_for_dev_without_reload.py,sha256=_7Zf0_Wciui4cHJSmpRXYVU7MakWCafIqek52LbfwSI,152
14
12
  arpakitlib/_arpakit_project_template/manage/docker_ps.sh,sha256=uwm8vHgeuNLCOn0o9hgP_uc-PUkS9FwLyzZh6ItZ3do,15
15
13
  arpakitlib/_arpakit_project_template/manage/docker_ps_a.sh,sha256=nOQejihYlzstg9oROvYwHIsSLt2Sw0DWQEeT3GBaBNs,18
16
14
  arpakitlib/_arpakit_project_template/manage/docker_run_postgres_for_dev.sh,sha256=EKytHfg5nDIen_QZhltfU7fHNJ68cSbM2ab13smKnTk,276
@@ -73,8 +71,8 @@ arpakitlib/_arpakit_project_template/src/additional_model/__init__.py,sha256=47D
73
71
  arpakitlib/_arpakit_project_template/src/additional_model/additional_model.py,sha256=4KCOvto9Hj5eMYpvfaJChghhR9bkCvKluGGPWrTezoY,134
74
72
  arpakitlib/_arpakit_project_template/src/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
73
  arpakitlib/_arpakit_project_template/src/api/asgi.py,sha256=a5UBxOyNC8NG3E0ayhiDo3t5tPoB3WtOf2gbZJFWBAA,74
76
- arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=5DQ2Ai9ANLpZwZS3MrGJBcqUtGArQOq12gf0cNtNb3k,4378
77
- arpakitlib/_arpakit_project_template/src/api/event.py,sha256=zxPHIJyGu1QwgDXF0GQD-SIWO-jooYeHbtW-QcbT8Ks,805
74
+ arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=GiGYR6Co5F1BfIyWK3_qqhcw9TlfsQedv2_YQVqtFnM,4414
75
+ arpakitlib/_arpakit_project_template/src/api/event.py,sha256=58wCVyVSIe_kydWi44M0Wvp7bTnV8xvO30gMXzjbFYc,750
78
76
  arpakitlib/_arpakit_project_template/src/api/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
77
  arpakitlib/_arpakit_project_template/src/api/router/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
78
  arpakitlib/_arpakit_project_template/src/api/router/v1/main_router.py,sha256=7MnhMwhmkYlbtvhmprXJ8nfs_iOPYBluwhcef5e_EBY,64
@@ -94,7 +92,7 @@ arpakitlib/_arpakit_project_template/src/db/sqlalchemy_model.py,sha256=nXtayUkBa
94
92
  arpakitlib/_arpakit_project_template/src/db/util.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
93
  arpakitlib/_arpakit_project_template/src/operation_execution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
94
  arpakitlib/_arpakit_project_template/src/operation_execution/operation_executor.py,sha256=jAcBicGYq78p4LZe4G3tU1hRxIsODBRoHerhExZab4k,619
97
- arpakitlib/_arpakit_project_template/src/operation_execution/scheduled_operations.py,sha256=cjjL7KE9LxBFLBo0rdvR53F7i_jomdH5gIbcbBodQKQ,438
95
+ arpakitlib/_arpakit_project_template/src/operation_execution/scheduled_operations.py,sha256=xJDPt_3Jo5huOerqY5TUi5DB2W9eI8WcPvSbEPFbImc,464
98
96
  arpakitlib/_arpakit_project_template/src/operation_execution/start_create_scheduled_operation_worker.py,sha256=L1TMmGOTPAyTQNxgTMKCJZAQgqxv8bwNipbrrNURw2U,572
99
97
  arpakitlib/_arpakit_project_template/src/operation_execution/start_operation_executor_for_dev.py,sha256=UHGVZi5-jO0J8FDpRkYJS046oRmwtbt3mrJ9vtYT6WE,587
100
98
  arpakitlib/_arpakit_project_template/src/test_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -153,7 +151,7 @@ arpakitlib/ar_logging_util.py,sha256=Gyd7B9k0glIXPm6dASiigWLq9LC9lw6vhXTCeWpY5PY
153
151
  arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
154
152
  arpakitlib/ar_need_type_util.py,sha256=xq5bbAXJG-93CRVZUcLW0ZdM22rj-ZUW17C5hX_5grg,1699
155
153
  arpakitlib/ar_openai_api_client_util.py,sha256=dHUbfg1sVVCjsNl_fra3iCMEz1bR-Hk9fE-DdYbu7Wc,1215
156
- arpakitlib/ar_operation_execution_util.py,sha256=G7K8Dga1oFoixx8S_fLI3AFnMe0dzyz6MKjePjvpyTE,12882
154
+ arpakitlib/ar_operation_execution_util.py,sha256=eDGVEFYDO3pFyCg7WGUglyBLs6QkHSYNpAmGpT0zqp4,12883
157
155
  arpakitlib/ar_parse_command.py,sha256=-s61xcATIsfw1eV_iD3xi-grsitbGzSDoAFc5V0OFy4,3447
158
156
  arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
159
157
  arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
@@ -167,9 +165,9 @@ arpakitlib/ar_str_util.py,sha256=oCEtQ_TTn35OEz9jCNLjbhopq76JmaifD_iYR-nEJJ4,214
167
165
  arpakitlib/ar_type_util.py,sha256=GNc9PgFKonj5lRlAHSnVPBN5nLIslrG8GTiZHjkf05w,2138
168
166
  arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
169
167
  arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
170
- arpakitlib-1.7.33.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
171
- arpakitlib-1.7.33.dist-info/METADATA,sha256=iObiDKwdu4b4op3VjyTJzWkSfWR1q3LkS9N5Ni1qzFk,2824
172
- arpakitlib-1.7.33.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
173
- arpakitlib-1.7.33.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
174
- arpakitlib-1.7.33.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
175
- arpakitlib-1.7.33.dist-info/RECORD,,
168
+ arpakitlib-1.7.35.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
169
+ arpakitlib-1.7.35.dist-info/METADATA,sha256=nDzRnz4ZaZA4eaV8SA-DettkNooOL6i9alsGt2evA1U,2824
170
+ arpakitlib-1.7.35.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
171
+ arpakitlib-1.7.35.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
172
+ arpakitlib-1.7.35.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
173
+ arpakitlib-1.7.35.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- from src.api.start_api_for_dev import start_api_for_dev
2
-
3
-
4
- def command():
5
- start_api_for_dev(reload=True)
6
-
7
-
8
- if __name__ == '__main__':
9
- command()
@@ -1,9 +0,0 @@
1
- from src.api.start_api_for_dev import start_api_for_dev
2
-
3
-
4
- def command():
5
- start_api_for_dev(reload=False)
6
-
7
-
8
- if __name__ == '__main__':
9
- command()