Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
0a7eea16
Commit
0a7eea16
authored
Dec 14, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脚本类数据
parent
cae3413c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
8 deletions
+28
-8
RedisKeyNameEnum.java
...n-core/src/main/java/com/byit/enums/RedisKeyNameEnum.java
+1
-0
FastRunLogServiceImpl.java
...ain/java/com/byit/service/impl/FastRunLogServiceImpl.java
+12
-2
RunNodeServiceImpl.java
...c/main/java/com/byit/service/impl/RunNodeServiceImpl.java
+8
-2
RunRecordingAndJobTaskServiceImpl.java
...ce/mapservice/impl/RunRecordingAndJobTaskServiceImpl.java
+7
-4
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/enums/RedisKeyNameEnum.java
View file @
0a7eea16
...
...
@@ -9,6 +9,7 @@ public enum RedisKeyNameEnum {
* 调度中心公共参数
*/
REDIS_PUBLIC_PARAM_KEY
(
"myth:param:public:%s%s"
),
REDIS_FLOW_ERROR_MSG_KEY
(
"myth:error:msg:%s:%s:"
),
;
private
final
String
keyName
;
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/FastRunLogServiceImpl.java
View file @
0a7eea16
package
com
.
byit
.
service
.
impl
;
import
com.byit.enums.EmailEnum
;
import
com.byit.enums.RedisKeyNameEnum
;
import
com.byit.enums.RunRecordingEnum
;
import
com.byit.enums.task.RunResultEnum
;
import
com.byit.enums.task.RunTypeEnum
;
...
...
@@ -8,8 +9,9 @@ import com.byit.model.JobTaskRunLogWithBLOBs;
import
com.byit.model.JobTaskSchedule
;
import
com.byit.service.FastRunLogService
;
import
com.byit.service.JobTaskRunLogService
;
import
com.byit.util.SpringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
...
...
@@ -22,9 +24,11 @@ import java.util.Date;
public
class
FastRunLogServiceImpl
implements
FastRunLogService
{
private
final
JobTaskRunLogService
jobTaskRunLogService
;
public
static
final
String
LINE
=
"\n"
;
private
final
StringRedisTemplate
stringRedisTemplate
;
public
FastRunLogServiceImpl
(
JobTaskRunLogService
jobTaskRunLogService
)
{
public
FastRunLogServiceImpl
(
JobTaskRunLogService
jobTaskRunLogService
,
StringRedisTemplate
stringRedisTemplate
)
{
this
.
jobTaskRunLogService
=
jobTaskRunLogService
;
this
.
stringRedisTemplate
=
stringRedisTemplate
;
}
@Override
...
...
@@ -77,6 +81,12 @@ public class FastRunLogServiceImpl implements FastRunLogService {
}
else
{
jobTaskRunLog
.
setRunMsg
(
msg
+
LINE
);
}
String
format
=
String
.
format
(
RedisKeyNameEnum
.
REDIS_FLOW_ERROR_MSG_KEY
.
getKeyName
(),
mythJobTaskSchedule
.
getRunId
(),
mythJobTaskSchedule
.
getFlowName
());
String
errorMsg
=
stringRedisTemplate
.
opsForValue
().
get
(
format
);
if
(
StringUtils
.
isNoneBlank
(
errorMsg
))
{
jobTaskRunLog
.
setRunMsg
(
errorMsg
+
LINE
);
stringRedisTemplate
.
delete
(
format
);
}
jobTaskRunLog
.
setRunCount
(
jobTaskRunLogById
.
getRunCount
()+
1
);
jobTaskRunLogService
.
updateJobTaskRunLogWithBLOBs
(
jobTaskRunLog
);
log
.
info
(
"-----------saveErrorLog--保存KILL脚本调度日志结束------------"
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/RunNodeServiceImpl.java
View file @
0a7eea16
...
...
@@ -2,11 +2,13 @@ package com.byit.service.impl;
import
com.byit.dto.BeanStrategyPackage
;
import
com.byit.enums.NodeNameEnum
;
import
com.byit.enums.RedisKeyNameEnum
;
import
com.byit.enums.RunRecordingEnum
;
import
com.byit.enums.ScheduleTypeEnum
;
import
com.byit.enums.task.RunResultEnum
;
import
com.byit.event.FlowScanEndEvent
;
import
com.byit.job.utils.CronExpression
;
import
com.byit.job.utils.MythLogUtils
;
import
com.byit.model.Flow
;
import
com.byit.model.JobTask
;
import
com.byit.model.Node
;
...
...
@@ -22,6 +24,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisherAware
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -40,6 +43,7 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis
private
final
JobTaskService
jobTaskService
;
private
final
FlowService
flowService
;
private
ApplicationEventPublisher
applicationEventPublisher
;
private
final
StringRedisTemplate
stringRedisTemplate
;
@Value
(
"${server.port}"
)
private
Integer
serverPort
;
/**
...
...
@@ -48,10 +52,11 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis
private
final
NodeDependencyService
nodeDependencyService
;
public
RunNodeServiceImpl
(
RunRecordingService
runRecordingService
,
JobTaskService
jobTaskService
,
FlowService
flowService
,
NodeDependencyService
nodeDependencyService
)
{
FlowService
flowService
,
StringRedisTemplate
stringRedisTemplate
,
NodeDependencyService
nodeDependencyService
)
{
this
.
runRecordingService
=
runRecordingService
;
this
.
jobTaskService
=
jobTaskService
;
this
.
flowService
=
flowService
;
this
.
stringRedisTemplate
=
stringRedisTemplate
;
this
.
nodeDependencyService
=
nodeDependencyService
;
}
...
...
@@ -120,7 +125,8 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
String
format
=
String
.
format
(
RedisKeyNameEnum
.
REDIS_FLOW_ERROR_MSG_KEY
.
getKeyName
(),
build
.
getRunId
(),
build
.
getFlowName
());
stringRedisTemplate
.
opsForValue
().
set
(
format
,
MythLogUtils
.
getMessage
(
e
));
build
.
setFlowStatus
(
RunRecordingEnum
.
FLOW_STATUS_IS_END
.
getCode
());
build
.
setFlowRunResult
(
RunResultEnum
.
RUN_ERROR
.
getCode
());
build
.
setFailFast
(
RunRecordingEnum
.
FAIL_FAST_YES
.
getCode
());
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/mapservice/impl/RunRecordingAndJobTaskServiceImpl.java
View file @
0a7eea16
...
...
@@ -2,11 +2,10 @@ package com.byit.service.mapservice.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.byit.dto.BeanStrategyPackage
;
import
com.byit.dto.RunRecordingWrapped
;
import
com.byit.enums.*
;
import
com.byit.enums.task.RunResultEnum
;
import
com.byit.job.utils.CronExpression
;
import
com.byit.job.utils.
DateUtil
;
import
com.byit.job.utils.
MythLogUtils
;
import
com.byit.model.*
;
import
com.byit.service.*
;
import
com.byit.service.mapservice.RunRecordingAndJobTaskService
;
...
...
@@ -16,6 +15,7 @@ import com.byit.util.SpringUtil;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -41,6 +41,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
private
final
JobTaskService
jobTaskService
;
private
final
WaitingRecordService
waitingRecordService
;
private
final
WaitingTaskService
taskService
;
private
final
StringRedisTemplate
stringRedisTemplate
;
/**
* 节点依赖查询操作
*/
...
...
@@ -48,7 +49,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
public
RunRecordingAndJobTaskServiceImpl
(
JobTaskRunLogService
jobTaskRunLogService
,
NodeService
nodeService
,
FlowService
flowService
,
RunRecordingService
runRecordingService
,
JobTaskService
jobTaskService
,
WaitingRecordService
waitingRecordService
,
WaitingTaskService
taskService
,
NodeDependencyService
nodeDependencyService
)
{
JobTaskService
jobTaskService
,
WaitingRecordService
waitingRecordService
,
WaitingTaskService
taskService
,
StringRedisTemplate
stringRedisTemplate
,
NodeDependencyService
nodeDependencyService
)
{
this
.
jobTaskRunLogService
=
jobTaskRunLogService
;
this
.
nodeService
=
nodeService
;
this
.
flowService
=
flowService
;
...
...
@@ -56,6 +57,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
this
.
jobTaskService
=
jobTaskService
;
this
.
waitingRecordService
=
waitingRecordService
;
this
.
taskService
=
taskService
;
this
.
stringRedisTemplate
=
stringRedisTemplate
;
this
.
nodeDependencyService
=
nodeDependencyService
;
}
/**
...
...
@@ -282,7 +284,8 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
String
format
=
String
.
format
(
RedisKeyNameEnum
.
REDIS_FLOW_ERROR_MSG_KEY
.
getKeyName
(),
runRecording
.
getRunId
(),
runRecording
.
getFlowName
());
stringRedisTemplate
.
opsForValue
().
set
(
format
,
MythLogUtils
.
getMessage
(
e
));
runRecording
.
setFlowStatus
(
RunRecordingEnum
.
FLOW_STATUS_IS_END
.
getCode
());
runRecording
.
setFlowRunResult
(
RunResultEnum
.
RUN_ERROR
.
getCode
());
runRecording
.
setFailFast
(
RunRecordingEnum
.
FAIL_FAST_YES
.
getCode
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment