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
7449393e
Commit
7449393e
authored
Apr 29, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消日志文件重复添加BUG
parent
8388512b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
20 deletions
+16
-20
FlowThreadRunHelper.java
...main/java/com/byit/thread/helper/FlowThreadRunHelper.java
+0
-5
ScheduleThreadRunHelper.java
.../java/com/byit/thread/helper/ScheduleThreadRunHelper.java
+13
-12
AddComplexPy1.java
...demo-client/src/main/java/com/byit/job/AddComplexPy1.java
+3
-3
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/FlowThreadRunHelper.java
View file @
7449393e
...
...
@@ -45,11 +45,6 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper {
if
(
CollectionUtil
.
isNotEmpty
(
halfAnHourFlow
))
{
for
(
Flow
flow
:
halfAnHourFlow
){
log
.
debug
(
"-----------------【工作流{}的执行次数不等于0,放行】-------------------------"
,
flow
.
getFlowName
());
/*if (runRecordingService.findRunRecordingIsRunning(flow.getFlowId())) {
//TODO 是否可以使用事件通知机制,由完结的工作流实例通知通过流可以运行了
log.info("-----工作流{},有正在运行中的实例,跳过等待------",flow)
continue;
}*/
Integer
flowId
=
flow
.
getFlowId
();
//根据工作流查询工作流下所有的节点
List
<
Node
>
nodeByFlowIdAndVersionName
=
nodeService
.
findNodeByFlowIdAndVersionName
(
flowId
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/ScheduleThreadRunHelper.java
View file @
7449393e
...
...
@@ -55,14 +55,7 @@ public class ScheduleThreadRunHelper extends BaseThreadRunHelper {
mythJobTaskSchedule
.
setRunParam
(
PlaceholderUtils
.
formatParam
(
mythJobTaskSchedule
.
getRunParam
()));
}
//如果是重跑就有logId
Integer
logId
=
mythJobTaskSchedule
.
getLogId
();
if
(
logId
==
null
){
log
.
debug
(
"-------------发现节点{}不是重跑,执行日志节点数据初始化-----------"
,
mythJobTaskSchedule
);
logId
=
saveLog
(
mythJobTaskSchedule
);
log
.
debug
(
"------------{}节点的日志保存成功,日志ID为{}---------------"
,
mythJobTaskSchedule
,
logId
);
}
mythJobTaskSchedule
.
setLogId
(
logId
);
Long
triggerTime
=
mythJobTaskSchedule
.
getTriggerTime
();
TimerTask
timerTask
=
null
;
if
(
NodeTypeEnum
.
JAVA
.
getType
().
equals
(
mythJobTaskSchedule
.
getJobType
()))
{
...
...
@@ -82,9 +75,9 @@ public class ScheduleThreadRunHelper extends BaseThreadRunHelper {
//构建脚本调度执行器
timerTask
=
new
ScriptExecutorJobTask
(
mythJobTaskSchedule
);
}
//TODO 有个坑 如果这个类型不存在的话 这个节点就不会被执行和删除 有没有办法能够强制必须有类型呢?
if
(
timerTask
!=
null
){
log
.
debug
(
"------节点{}的执行器{}执行添加到任务调度轮的操作-------"
,
mythJobTaskSchedule
,
timerTask
);
saveLog
(
mythJobTaskSchedule
);
WorkRoulette
.
addJob
(
timerTask
,
triggerTime
);
jobTaskScheduleService
.
delete
(
mythJobTaskSchedule
.
getId
());
}
...
...
@@ -106,14 +99,22 @@ public class ScheduleThreadRunHelper extends BaseThreadRunHelper {
return
LOCK_NAME
;
}
private
Integer
saveLog
(
JobTaskSchedule
mythJobTaskSchedule
){
private
void
saveLog
(
JobTaskSchedule
mythJobTaskSchedule
){
//如果是重跑就有logId
Integer
logId
=
mythJobTaskSchedule
.
getLogId
();
if
(
logId
==
null
){
log
.
debug
(
"-------------发现节点{}不是重跑,执行日志节点数据初始化-----------"
,
mythJobTaskSchedule
);
JobTaskRunLogWithBLOBs
jobTaskRunLog
=
new
JobTaskRunLogWithBLOBs
();
BeanUtils
.
copyProperties
(
mythJobTaskSchedule
,
jobTaskRunLog
);
jobTaskRunLog
.
setLogId
(
null
);
JobTaskRunLogServiceImpl
mythJobTaskRunLogService
=
SpringUtil
.
getBean
(
JobTaskRunLogServiceImpl
.
class
);
mythJobTaskRunLogService
.
saveJobTaskRunLog
(
jobTaskRunLog
);
return
jobTaskRunLog
.
getLogId
();
logId
=
jobTaskRunLog
.
getLogId
();
log
.
debug
(
"------------{}节点的日志保存成功,日志ID为{}---------------"
,
mythJobTaskSchedule
,
logId
);
}
mythJobTaskSchedule
.
setLogId
(
logId
);
}
}
demo-client/byit-demo-client/src/main/java/com/byit/job/AddComplexPy1.java
View file @
7449393e
...
...
@@ -15,11 +15,11 @@ public class AddComplexPy1 {
public
static
void
main
(
String
[]
args
)
{
PluginPackage
pluginPackage
=
new
PluginPackage
();
pluginPackage
.
setWorkspaceName
(
"test"
);
pluginPackage
.
setWorkspaceName
(
"
huangfu
test"
);
pluginPackage
.
setFlow
(
createFlow
());
JobUtils
.
setRequestUrl
(
"http://127.0.0.1:8081/myth-job-admin"
);
JobUtils
.
setTOKEN
(
"test"
);
//JobUtils.addWorkspace("test");
//JobUtils.addWorkspace("
huangfu
test");
JobUtils
.
publish
(
pluginPackage
);
}
...
...
@@ -37,7 +37,7 @@ public class AddComplexPy1 {
.
scheduleFollow
(
"1"
)
.
build
();
pluginFlow
.
setName
(
"
复杂工作流11
"
);
pluginFlow
.
setName
(
"
奥术大师多撒多
"
);
pluginFlow
.
setDesc
(
"测试多脚本复杂工作流创建"
);
pluginFlow
.
setConfig
(
build
);
pluginFlow
.
setPrincipal
(
"皇甫科星"
);
...
...
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