watchmen-collector-kernel 16.4.8__py3-none-any.whl → 16.4.9__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.
- watchmen_collector_kernel/model/__init__.py +1 -1
- watchmen_collector_kernel/model/scheduled_task.py +2 -8
- watchmen_collector_kernel/service/task_service.py +3 -3
- watchmen_collector_kernel/storage/change_data_json_service.py +2 -0
- watchmen_collector_kernel/storage/scheduled_task_service.py +5 -5
- {watchmen_collector_kernel-16.4.8.dist-info → watchmen_collector_kernel-16.4.9.dist-info}/METADATA +9 -9
- {watchmen_collector_kernel-16.4.8.dist-info → watchmen_collector_kernel-16.4.9.dist-info}/RECORD +9 -9
- {watchmen_collector_kernel-16.4.8.dist-info → watchmen_collector_kernel-16.4.9.dist-info}/LICENSE +0 -0
- {watchmen_collector_kernel-16.4.8.dist-info → watchmen_collector_kernel-16.4.9.dist-info}/WHEEL +0 -0
@@ -2,7 +2,7 @@ from typing import Dict, List
|
|
2
2
|
|
3
3
|
from watchmen_model.common import TenantBasedTuple, ScheduledTaskId, Storable
|
4
4
|
from pydantic import BaseModel
|
5
|
-
from enum import Enum
|
5
|
+
from enum import Enum
|
6
6
|
|
7
7
|
|
8
8
|
class Result(str, Enum):
|
@@ -11,12 +11,6 @@ class Result(str, Enum):
|
|
11
11
|
PROCESS_TASK_FAILED = "PROCESS_TASK_FAILED"
|
12
12
|
|
13
13
|
|
14
|
-
class TaskStatus(IntEnum):
|
15
|
-
INITIAL = 0
|
16
|
-
SUCCESS = 1
|
17
|
-
FAILED = 2
|
18
|
-
|
19
|
-
|
20
14
|
class Dependence(Storable, BaseModel):
|
21
15
|
modelName: str
|
22
16
|
objectId: str
|
@@ -31,6 +25,6 @@ class ScheduledTask(TenantBasedTuple, BaseModel):
|
|
31
25
|
objectId: str
|
32
26
|
dependOn: List[Dependence]
|
33
27
|
parentTaskId: List[int]
|
34
|
-
|
28
|
+
isFinished: bool
|
35
29
|
result: Dict
|
36
30
|
|
@@ -3,7 +3,7 @@ from traceback import format_exc
|
|
3
3
|
from typing import Callable, Dict, Optional, List
|
4
4
|
|
5
5
|
from watchmen_auth import PrincipalService
|
6
|
-
from watchmen_collector_kernel.model import ScheduledTask
|
6
|
+
from watchmen_collector_kernel.model import ScheduledTask
|
7
7
|
from watchmen_collector_kernel.model.scheduled_task import Dependence
|
8
8
|
from watchmen_collector_kernel.storage import get_scheduled_task_service
|
9
9
|
from watchmen_model.common import ScheduledTaskId
|
@@ -31,11 +31,11 @@ class TaskService:
|
|
31
31
|
def consume_task(self, task: ScheduledTask, executed: Callable[[str, Dict, str], None]) -> ScheduledTask:
|
32
32
|
try:
|
33
33
|
executed(task.topicCode, task.content, task.tenantId)
|
34
|
-
task.
|
34
|
+
task.isFinished = True
|
35
35
|
return self.scheduled_task_service.update_task(task)
|
36
36
|
except Exception as e:
|
37
37
|
logger.error(e, exc_info=True, stack_info=True)
|
38
|
-
task.
|
38
|
+
task.isFinished = True
|
39
39
|
task.result = format_exc()
|
40
40
|
return self.scheduled_task_service.update_task(task)
|
41
41
|
|
@@ -24,6 +24,7 @@ class ChangeDataJsonShaper(EntityShaper):
|
|
24
24
|
'content': entity.content,
|
25
25
|
'depend_on': entity.dependOn,
|
26
26
|
'is_posted': entity.isPosted,
|
27
|
+
'result': entity.result,
|
27
28
|
'task_id': entity.taskId,
|
28
29
|
'table_trigger_id': entity.tableTriggerId,
|
29
30
|
'model_trigger_id': entity.modelTriggerId,
|
@@ -43,6 +44,7 @@ class ChangeDataJsonShaper(EntityShaper):
|
|
43
44
|
content=row.get('content'),
|
44
45
|
dependOn=row.get('depend_on'),
|
45
46
|
isPosted=row.get('is_posted'),
|
47
|
+
result=row.get('result'),
|
46
48
|
taskId=row.get('task_id'),
|
47
49
|
tableTriggerId=row.get('table_trigger_id'),
|
48
50
|
modelTriggerId=row.get('model_trigger_id'),
|
@@ -23,7 +23,7 @@ class ScheduledTaskShaper(EntityShaper):
|
|
23
23
|
'depend_on': entity.dependOn,
|
24
24
|
'parent_task_id': entity.parentTaskId,
|
25
25
|
'tenant_id': entity.tenantId,
|
26
|
-
'
|
26
|
+
'is_finished': entity.isFinished,
|
27
27
|
'result': entity.result
|
28
28
|
})
|
29
29
|
|
@@ -39,7 +39,7 @@ class ScheduledTaskShaper(EntityShaper):
|
|
39
39
|
dependOn=row.get('depend_on'),
|
40
40
|
parentTaskId=row.get('parent_task_id'),
|
41
41
|
tenantId=row.get('tenant_id'),
|
42
|
-
|
42
|
+
isFinished=row.get('is_finished'),
|
43
43
|
result=row.get('result')
|
44
44
|
))
|
45
45
|
|
@@ -107,7 +107,7 @@ class ScheduledTaskService(TupleService):
|
|
107
107
|
criteria=[EntityCriteriaJoint(
|
108
108
|
children=[
|
109
109
|
EntityCriteriaExpression(
|
110
|
-
left=ColumnNameLiteral(columnName='
|
110
|
+
left=ColumnNameLiteral(columnName='is_finished'), right=False)
|
111
111
|
]
|
112
112
|
)],
|
113
113
|
straightColumns=[EntityStraightColumn(columnName='task_id'),
|
@@ -139,8 +139,8 @@ class ScheduledTaskService(TupleService):
|
|
139
139
|
right=model_name),
|
140
140
|
EntityCriteriaExpression(left=ColumnNameLiteral(columnName='object_id'),
|
141
141
|
right=object_id),
|
142
|
-
EntityCriteriaExpression(left=ColumnNameLiteral(columnName='
|
143
|
-
right=
|
142
|
+
EntityCriteriaExpression(left=ColumnNameLiteral(columnName='is_finished'),
|
143
|
+
right=False),
|
144
144
|
EntityCriteriaExpression(left=ColumnNameLiteral(columnName='tenant_id'),
|
145
145
|
right=tenant_id)
|
146
146
|
]
|
{watchmen_collector_kernel-16.4.8.dist-info → watchmen_collector_kernel-16.4.9.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: watchmen-collector-kernel
|
3
|
-
Version: 16.4.
|
3
|
+
Version: 16.4.9
|
4
4
|
Summary:
|
5
5
|
License: MIT
|
6
6
|
Author: botlikes
|
@@ -18,11 +18,11 @@ Provides-Extra: oracle
|
|
18
18
|
Provides-Extra: oss
|
19
19
|
Provides-Extra: postgresql
|
20
20
|
Provides-Extra: s3
|
21
|
-
Requires-Dist: watchmen-data-kernel (==16.4.
|
22
|
-
Requires-Dist: watchmen-storage-mongodb (==16.4.
|
23
|
-
Requires-Dist: watchmen-storage-mssql (==16.4.
|
24
|
-
Requires-Dist: watchmen-storage-mysql (==16.4.
|
25
|
-
Requires-Dist: watchmen-storage-oracle (==16.4.
|
26
|
-
Requires-Dist: watchmen-storage-oss (==16.4.
|
27
|
-
Requires-Dist: watchmen-storage-postgresql (==16.4.
|
28
|
-
Requires-Dist: watchmen-storage-s3 (==16.4.
|
21
|
+
Requires-Dist: watchmen-data-kernel (==16.4.9)
|
22
|
+
Requires-Dist: watchmen-storage-mongodb (==16.4.9) ; extra == "mongodb"
|
23
|
+
Requires-Dist: watchmen-storage-mssql (==16.4.9) ; extra == "mssql"
|
24
|
+
Requires-Dist: watchmen-storage-mysql (==16.4.9) ; extra == "mysql"
|
25
|
+
Requires-Dist: watchmen-storage-oracle (==16.4.9) ; extra == "oracle"
|
26
|
+
Requires-Dist: watchmen-storage-oss (==16.4.9) ; extra == "oss"
|
27
|
+
Requires-Dist: watchmen-storage-postgresql (==16.4.9) ; extra == "postgresql"
|
28
|
+
Requires-Dist: watchmen-storage-s3 (==16.4.9) ; extra == "s3"
|
{watchmen_collector_kernel-16.4.8.dist-info → watchmen_collector_kernel-16.4.9.dist-info}/RECORD
RENAMED
@@ -1,14 +1,14 @@
|
|
1
1
|
watchmen_collector_kernel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
watchmen_collector_kernel/common/__init__.py,sha256=QJHylPJAMoSbSa6EfgiQTLNtkQKSCUJucf7ZG3Nqswg,175
|
3
3
|
watchmen_collector_kernel/common/constants.py,sha256=mIsGBhAjHbmeuVeNYDOKLhiBqG2sSX-0vs8ipEEIo9E,302
|
4
|
-
watchmen_collector_kernel/model/__init__.py,sha256=
|
4
|
+
watchmen_collector_kernel/model/__init__.py,sha256=PfA3bsFeAXTTQRSZMyzdm9Oe6dSqDR-y5vfQBlgAdSE,542
|
5
5
|
watchmen_collector_kernel/model/change_data_json.py,sha256=-oNIGsvYo8KJJsSFusbGa9kIuFfE0otLnWe-zz9O42A,495
|
6
6
|
watchmen_collector_kernel/model/change_data_record.py,sha256=vadzugcX4nl6G3F-jt7DtuVqjE8vtlasu86DDjpaGGM,330
|
7
7
|
watchmen_collector_kernel/model/collector_model_config.py,sha256=oE0T9I_9uGppttoytvzl7-35WgwlWu7s6awNtsK4Q20,288
|
8
8
|
watchmen_collector_kernel/model/collector_table_config.py,sha256=R80d2rqfVRj_rZ6-mognaLYe26R7r3g4nFR3Wj-4YLY,2143
|
9
9
|
watchmen_collector_kernel/model/competitive_lock.py,sha256=fxDRuzZpsgrZjGeuADS3zRYqQioqWhg72Pr592U_Yvw,264
|
10
10
|
watchmen_collector_kernel/model/condition.py,sha256=jGsjvb5z9XRFW0B55k-iC2_Zle4rl-A5J_6PB6EV6mA,1942
|
11
|
-
watchmen_collector_kernel/model/scheduled_task.py,sha256=
|
11
|
+
watchmen_collector_kernel/model/scheduled_task.py,sha256=tPk4CmBvL0E61jk-6TYJHD2Ch4k-NdF9tMBi8WPMWc4,674
|
12
12
|
watchmen_collector_kernel/model/trigger_event.py,sha256=ZjVgWQS_qqILchw4fGFzxn1tJUMx77s2_UpyiBd7azA,251
|
13
13
|
watchmen_collector_kernel/model/trigger_model.py,sha256=NpnIbdax8vQeGYeGcOMpWpjYUhkeZUil--6-yTNpv3k,175
|
14
14
|
watchmen_collector_kernel/model/trigger_table.py,sha256=aPYJlIb-8aX_-O6vZQp3DU58zYtyosYLGFjpL81ijds,229
|
@@ -20,19 +20,19 @@ watchmen_collector_kernel/service/extract_utils.py,sha256=PIyxFG7U37ZXLYlOdIK-Dh
|
|
20
20
|
watchmen_collector_kernel/service/lock_clean.py,sha256=qeNc8vZtfxXTNpGhGc_ZnUD9iRGK2VXNEpv1VglVWCA,965
|
21
21
|
watchmen_collector_kernel/service/lock_helper.py,sha256=GxqjIsCD-jn5kDICVWS1LlTFCuMpnRSpcrQtPLv5bxs,842
|
22
22
|
watchmen_collector_kernel/service/task_housekeeping.py,sha256=i1lnZ4jo-RLjLQD0Z7HSLQqjXuSqdL3zqHDfFVaNbe8,1673
|
23
|
-
watchmen_collector_kernel/service/task_service.py,sha256=
|
23
|
+
watchmen_collector_kernel/service/task_service.py,sha256=thA_PRNrWvx_g8tuwMbUUqrXBYgnYcBozoNohA4jqTI,3050
|
24
24
|
watchmen_collector_kernel/service/trigger_collector.py,sha256=IP_ILJNMhahBogtvfS1iHDOJAxKCDBDJFXTDi98R11M,6790
|
25
25
|
watchmen_collector_kernel/storage/__init__.py,sha256=sstizR2fcwo4ZhqfiqceTxxS49HTtfExCPMeEaYc9bc,832
|
26
|
-
watchmen_collector_kernel/storage/change_data_json_service.py,sha256=
|
26
|
+
watchmen_collector_kernel/storage/change_data_json_service.py,sha256=YwbHDff0W_ydfOJRXB8W_J4iE4VIj0XEwRrXd0KUWCg,7536
|
27
27
|
watchmen_collector_kernel/storage/change_data_record_service.py,sha256=MOju5vTl-ZQrpEfL7DytvB_T_JM0dYyXGAzrhNnzb2Y,7463
|
28
28
|
watchmen_collector_kernel/storage/collector_model_config_service.py,sha256=kWLjmppPpRuN0VptiAEGA38BJ20fFD5Q5gxPZJRbQYs,3830
|
29
29
|
watchmen_collector_kernel/storage/collector_table_config_service.py,sha256=aVZeN5AhzUORHaZQUDo_MlKcX6AkgcHcQeI6UwAoAT0,5659
|
30
30
|
watchmen_collector_kernel/storage/competitive_lock_service.py,sha256=jjxxHb4Dr0DIDX_g26wtCa8vGLGLnc4BJQGl0d3J31M,2534
|
31
|
-
watchmen_collector_kernel/storage/scheduled_task_service.py,sha256=
|
31
|
+
watchmen_collector_kernel/storage/scheduled_task_service.py,sha256=sZLwF8zKOArh8QuchkDPcip7B-kTyVBhHM73nxU89Tg,5376
|
32
32
|
watchmen_collector_kernel/storage/trigger_event_service.py,sha256=DKSCQ0sYSH3uAtGmokvncD9FIYvjoVsk7QtqdRMQGhM,3099
|
33
33
|
watchmen_collector_kernel/storage/trigger_model_service.py,sha256=0-_YcL5FNGHy2MKn8vTYrWFaYOPW_u4iKQRG00AOfCI,3219
|
34
34
|
watchmen_collector_kernel/storage/trigger_table_service.py,sha256=RHiFJaT3UQmCpz-gxnfsoBPV7lS8JM1i9DCQn3BnfA4,3779
|
35
|
-
watchmen_collector_kernel-16.4.
|
36
|
-
watchmen_collector_kernel-16.4.
|
37
|
-
watchmen_collector_kernel-16.4.
|
38
|
-
watchmen_collector_kernel-16.4.
|
35
|
+
watchmen_collector_kernel-16.4.9.dist-info/LICENSE,sha256=iuuG7ErblOdcEZi5u89VXS0VIUiTb4flerGp_PAS9E4,1061
|
36
|
+
watchmen_collector_kernel-16.4.9.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
|
37
|
+
watchmen_collector_kernel-16.4.9.dist-info/METADATA,sha256=Nr3F6yWxRJrnpIyEMYfecoJA9zGY8-5mH6Oeh5uyBXY,1135
|
38
|
+
watchmen_collector_kernel-16.4.9.dist-info/RECORD,,
|
{watchmen_collector_kernel-16.4.8.dist-info → watchmen_collector_kernel-16.4.9.dist-info}/LICENSE
RENAMED
File without changes
|
{watchmen_collector_kernel-16.4.8.dist-info → watchmen_collector_kernel-16.4.9.dist-info}/WHEEL
RENAMED
File without changes
|