arpakitlib 1.7.32__py3-none-any.whl → 1.7.33__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.
@@ -1,5 +1,6 @@
1
- from arpakitlib.ar_operation_execution_util import ScheduledOperation
1
+ from datetime import timedelta
2
2
 
3
+ from arpakitlib.ar_operation_execution_util import ScheduledOperation, every_timedelta
3
4
  from arpakitlib.ar_sqlalchemy_model_util import BaseOperationTypes
4
5
 
5
6
  ALL_SCHEDULED_OPERATIONS = []
@@ -7,6 +8,6 @@ ALL_SCHEDULED_OPERATIONS = []
7
8
  operation_healthcheck = ScheduledOperation(
8
9
  type=BaseOperationTypes.healthcheck_,
9
10
  input_data={},
10
- is_time_func=lambda: True
11
+ is_time_func=every_timedelta(td=timedelta(seconds=5))
11
12
  )
12
13
  ALL_SCHEDULED_OPERATIONS.append(operation_healthcheck)
@@ -0,0 +1,16 @@
1
+ from arpakitlib.ar_operation_execution_util import CreateScheduledOperationWorker
2
+ from src.core.util import get_cached_sqlalchemy_db, setup_logging
3
+ from src.operation_execution.scheduled_operations import ALL_SCHEDULED_OPERATIONS
4
+
5
+
6
+ def start_create_scheduled_operation_worker_for_dev():
7
+ setup_logging()
8
+ worker = CreateScheduledOperationWorker(
9
+ sqlalchemy_db=get_cached_sqlalchemy_db(),
10
+ scheduled_operations=ALL_SCHEDULED_OPERATIONS
11
+ )
12
+ worker.sync_safe_run()
13
+
14
+
15
+ if __name__ == '__main__':
16
+ start_create_scheduled_operation_worker_for_dev()
@@ -0,0 +1,17 @@
1
+ from arpakitlib.ar_operation_execution_util import ExecuteOperationWorker
2
+ from src.core.util import get_cached_sqlalchemy_db, setup_logging
3
+ from src.operation_execution.operation_executor import OperationExecutor
4
+
5
+
6
+ def start_operation_executor_for_dev():
7
+ setup_logging()
8
+ worker = ExecuteOperationWorker(
9
+ sqlalchemy_db=get_cached_sqlalchemy_db(),
10
+ operation_executor=OperationExecutor(sqlalchemy_db=get_cached_sqlalchemy_db()),
11
+ filter_operation_types=None
12
+ )
13
+ worker.sync_safe_run()
14
+
15
+
16
+ if __name__ == '__main__':
17
+ start_operation_executor_for_dev()
@@ -333,6 +333,20 @@ class CreateScheduledOperationWorker(BaseWorker):
333
333
  session.refresh(operation_dbm)
334
334
 
335
335
 
336
+ def every_timedelta(*, td: timedelta) -> Callable:
337
+ last_now_utc_dt = now_utc_dt()
338
+
339
+ def check_time() -> bool:
340
+ nonlocal last_now_utc_dt
341
+ now_utc_dt_ = now_utc_dt()
342
+ if (now_utc_dt_ - last_now_utc_dt) >= td:
343
+ last_now_utc_dt = now_utc_dt_
344
+ return True
345
+ return False
346
+
347
+ return check_time
348
+
349
+
336
350
  def __example():
337
351
  pass
338
352
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arpakitlib
3
- Version: 1.7.32
3
+ Version: 1.7.33
4
4
  Summary: arpakitlib
5
5
  Home-page: https://github.com/ARPAKIT-Company/arpakitlib
6
6
  License: Apache-2.0
@@ -94,7 +94,9 @@ arpakitlib/_arpakit_project_template/src/db/sqlalchemy_model.py,sha256=nXtayUkBa
94
94
  arpakitlib/_arpakit_project_template/src/db/util.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
95
  arpakitlib/_arpakit_project_template/src/operation_execution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
96
  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=1zVJ36uZdKJ_4_2XYhsZJ5T1aD_bgBz0U26SywSp8sU,362
97
+ arpakitlib/_arpakit_project_template/src/operation_execution/scheduled_operations.py,sha256=cjjL7KE9LxBFLBo0rdvR53F7i_jomdH5gIbcbBodQKQ,438
98
+ arpakitlib/_arpakit_project_template/src/operation_execution/start_create_scheduled_operation_worker.py,sha256=L1TMmGOTPAyTQNxgTMKCJZAQgqxv8bwNipbrrNURw2U,572
99
+ arpakitlib/_arpakit_project_template/src/operation_execution/start_operation_executor_for_dev.py,sha256=UHGVZi5-jO0J8FDpRkYJS046oRmwtbt3mrJ9vtYT6WE,587
98
100
  arpakitlib/_arpakit_project_template/src/test_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
101
  arpakitlib/_arpakit_project_template/src/test_data/make_test_data_1.py,sha256=3WVPgRsNCIxWpA-6t_Phe-nFULdHPhS1S_DO11XRmqk,80
100
102
  arpakitlib/_arpakit_project_template/src/test_data/make_test_data_2.py,sha256=MVDc71sj5I1muWin50GwrSxMwYtOOSDOtRmeFErHcXs,80
@@ -151,7 +153,7 @@ arpakitlib/ar_logging_util.py,sha256=Gyd7B9k0glIXPm6dASiigWLq9LC9lw6vhXTCeWpY5PY
151
153
  arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
152
154
  arpakitlib/ar_need_type_util.py,sha256=xq5bbAXJG-93CRVZUcLW0ZdM22rj-ZUW17C5hX_5grg,1699
153
155
  arpakitlib/ar_openai_api_client_util.py,sha256=dHUbfg1sVVCjsNl_fra3iCMEz1bR-Hk9fE-DdYbu7Wc,1215
154
- arpakitlib/ar_operation_execution_util.py,sha256=QwilFhe_wm_XuDVyyFZYBXcwXNKqLQJnCY2fFhpOdYw,12535
156
+ arpakitlib/ar_operation_execution_util.py,sha256=G7K8Dga1oFoixx8S_fLI3AFnMe0dzyz6MKjePjvpyTE,12882
155
157
  arpakitlib/ar_parse_command.py,sha256=-s61xcATIsfw1eV_iD3xi-grsitbGzSDoAFc5V0OFy4,3447
156
158
  arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
157
159
  arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
@@ -165,9 +167,9 @@ arpakitlib/ar_str_util.py,sha256=oCEtQ_TTn35OEz9jCNLjbhopq76JmaifD_iYR-nEJJ4,214
165
167
  arpakitlib/ar_type_util.py,sha256=GNc9PgFKonj5lRlAHSnVPBN5nLIslrG8GTiZHjkf05w,2138
166
168
  arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
167
169
  arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
168
- arpakitlib-1.7.32.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
169
- arpakitlib-1.7.32.dist-info/METADATA,sha256=M_gfVk9VgpW4OBn9CoyrDkjkYsro0YSgAiCXbio9ol4,2824
170
- arpakitlib-1.7.32.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
171
- arpakitlib-1.7.32.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
172
- arpakitlib-1.7.32.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
173
- arpakitlib-1.7.32.dist-info/RECORD,,
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,,