arpakitlib 1.8.57__py3-none-any.whl → 1.8.59__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/_arpakit_project_template_v_5/project/operation_execution/scheduled_operation_creator_worker.py +9 -2
- arpakitlib/_arpakit_project_template_v_5/project/operation_execution/util.py +8 -3
- {arpakitlib-1.8.57.dist-info → arpakitlib-1.8.59.dist-info}/METADATA +1 -1
- {arpakitlib-1.8.57.dist-info → arpakitlib-1.8.59.dist-info}/RECORD +7 -7
- {arpakitlib-1.8.57.dist-info → arpakitlib-1.8.59.dist-info}/LICENSE +0 -0
- {arpakitlib-1.8.57.dist-info → arpakitlib-1.8.59.dist-info}/WHEEL +0 -0
- {arpakitlib-1.8.57.dist-info → arpakitlib-1.8.59.dist-info}/entry_points.txt +0 -0
@@ -2,6 +2,7 @@ from datetime import timedelta
|
|
2
2
|
from typing import Any
|
3
3
|
|
4
4
|
from arpakitlib.ar_base_worker_util import BaseWorker
|
5
|
+
from arpakitlib.ar_json_util import transfer_data_to_json_str_to_data
|
5
6
|
from arpakitlib.ar_sleep_util import sync_safe_sleep, async_safe_sleep
|
6
7
|
from arpakitlib.ar_sqlalchemy_util import SQLAlchemyDb
|
7
8
|
from arpakitlib.ar_type_util import raise_for_type
|
@@ -45,7 +46,10 @@ class ScheduledOperationCreatorWorker(BaseWorker):
|
|
45
46
|
with self.sqlalchemy_db.new_session() as session:
|
46
47
|
operation_dbm = OperationDBM(
|
47
48
|
type=scheduled_operation.type,
|
48
|
-
input_data=
|
49
|
+
input_data=transfer_data_to_json_str_to_data(
|
50
|
+
data=scheduled_operation.input_data,
|
51
|
+
fast=True
|
52
|
+
),
|
49
53
|
status=OperationDBM.Statuses.waiting_for_execution
|
50
54
|
)
|
51
55
|
session.add(operation_dbm)
|
@@ -78,7 +82,10 @@ class ScheduledOperationCreatorWorker(BaseWorker):
|
|
78
82
|
async with self.sqlalchemy_db.new_async_session() as async_session:
|
79
83
|
operation_dbm = OperationDBM(
|
80
84
|
type=scheduled_operation.type,
|
81
|
-
input_data=
|
85
|
+
input_data=transfer_data_to_json_str_to_data(
|
86
|
+
data=scheduled_operation.input_data,
|
87
|
+
fast=True
|
88
|
+
),
|
82
89
|
)
|
83
90
|
async_session.add(operation_dbm)
|
84
91
|
await async_session.commit()
|
@@ -4,13 +4,18 @@ from typing import Callable
|
|
4
4
|
from arpakitlib.ar_datetime_util import now_utc_dt
|
5
5
|
|
6
6
|
|
7
|
-
def every_timedelta_is_time_func(
|
8
|
-
|
7
|
+
def every_timedelta_is_time_func(
|
8
|
+
*,
|
9
|
+
td: timedelta,
|
10
|
+
now_dt_func: Callable = now_utc_dt,
|
11
|
+
create_first_time: bool = False
|
12
|
+
) -> Callable:
|
13
|
+
last_now_utc_dt = None if create_first_time is not None else now_dt_func()
|
9
14
|
|
10
15
|
def func() -> bool:
|
11
16
|
nonlocal last_now_utc_dt
|
12
17
|
now_dt_func_ = now_dt_func()
|
13
|
-
if (now_dt_func_ - last_now_utc_dt) >= td:
|
18
|
+
if last_now_utc_dt is None or (now_dt_func_ - last_now_utc_dt) >= td:
|
14
19
|
last_now_utc_dt = now_dt_func_
|
15
20
|
return True
|
16
21
|
return False
|
@@ -173,9 +173,9 @@ arpakitlib/_arpakit_project_template_v_5/project/more/helloworld,sha256=eH7Hbcr9
|
|
173
173
|
arpakitlib/_arpakit_project_template_v_5/project/operation_execution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
174
174
|
arpakitlib/_arpakit_project_template_v_5/project/operation_execution/const.py,sha256=dcvj5C9E2F2KCsGZPBBncQf_EvVJAC1qQgnyD8P4ZEw,6
|
175
175
|
arpakitlib/_arpakit_project_template_v_5/project/operation_execution/operation_executor_worker.py,sha256=pAcvuAVgWc86Vyx3-I21rPvBr9ZxUNaLRoS7VEwkETw,12129
|
176
|
-
arpakitlib/_arpakit_project_template_v_5/project/operation_execution/scheduled_operation_creator_worker.py,sha256=
|
176
|
+
arpakitlib/_arpakit_project_template_v_5/project/operation_execution/scheduled_operation_creator_worker.py,sha256=WzZC6r0GVSwOpphsxqpRZIdeewK_wzi3YshjLOutYGA,4524
|
177
177
|
arpakitlib/_arpakit_project_template_v_5/project/operation_execution/scheduled_operations.py,sha256=WZyRWzrLvGre_1TjWy0I8V7WfKFZJ0f_8LuZZNrzgy8,1712
|
178
|
-
arpakitlib/_arpakit_project_template_v_5/project/operation_execution/util.py,sha256=
|
178
|
+
arpakitlib/_arpakit_project_template_v_5/project/operation_execution/util.py,sha256=sqHF2AU5Y5IurYHcIH2bu3-JbS1amLO3GD13Zvy8epM,923
|
179
179
|
arpakitlib/_arpakit_project_template_v_5/project/resource/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
180
180
|
arpakitlib/_arpakit_project_template_v_5/project/resource/static/1,sha256=IIO7Wvjwlr2-LPSQ7Y8O35hcI6t0_s8zqITDxkYCO8I,11
|
181
181
|
arpakitlib/_arpakit_project_template_v_5/project/resource/static/healthcheck,sha256=IIO7Wvjwlr2-LPSQ7Y8O35hcI6t0_s8zqITDxkYCO8I,11
|
@@ -371,8 +371,8 @@ arpakitlib/ar_str_util.py,sha256=NisRtt4xwE7qthkkXzL49jvGKMGlvJ4KKcvpQfmRlIw,441
|
|
371
371
|
arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
|
372
372
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
|
373
373
|
arpakitlib/ar_zabbix_api_client_util.py,sha256=oHNS-2WckQxp7cVqsRne9JgkP9I7RQGBKVKZSMLN8zw,9427
|
374
|
-
arpakitlib-1.8.
|
375
|
-
arpakitlib-1.8.
|
376
|
-
arpakitlib-1.8.
|
377
|
-
arpakitlib-1.8.
|
378
|
-
arpakitlib-1.8.
|
374
|
+
arpakitlib-1.8.59.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
375
|
+
arpakitlib-1.8.59.dist-info/METADATA,sha256=Ds4ag2x0E0_pO_2dY6QirQb1S2E_O4wnoZjYQs9dGdI,3475
|
376
|
+
arpakitlib-1.8.59.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
377
|
+
arpakitlib-1.8.59.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
378
|
+
arpakitlib-1.8.59.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|