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
656a9477
Commit
656a9477
authored
Sep 28, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加永不超时选项
parent
b83665f8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
JavaTaskCallbackThread.java
...src/main/java/com/byit/thread/JavaTaskCallbackThread.java
+16
-11
TimeoutExampleThreadRunHelper.java
...com/byit/thread/helper/TimeoutExampleThreadRunHelper.java
+3
-0
ReturnResult.java
...dto-core/src/main/java/com/byit/dto/web/ReturnResult.java
+1
-0
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/JavaTaskCallbackThread.java
View file @
656a9477
...
@@ -24,39 +24,44 @@ public class JavaTaskCallbackThread implements Runnable {
...
@@ -24,39 +24,44 @@ public class JavaTaskCallbackThread implements Runnable {
public
JavaTaskCallbackThread
(
PluginRpcResponsePacket
pluginRpcResponsePacket
)
{
public
JavaTaskCallbackThread
(
PluginRpcResponsePacket
pluginRpcResponsePacket
)
{
this
.
pluginRpcResponsePacket
=
pluginRpcResponsePacket
;
this
.
pluginRpcResponsePacket
=
pluginRpcResponsePacket
;
}
}
@Override
@Override
public
void
run
()
{
public
void
run
()
{
String
logIdStr
=
pluginRpcResponsePacket
.
getExtension
();
String
logIdStr
=
pluginRpcResponsePacket
.
getExtension
();
int
logId
=
Integer
.
parseInt
(
logIdStr
);
int
logId
=
Integer
.
parseInt
(
logIdStr
);
JobTaskRunLogServiceImpl
mythJobTaskRunLogService
=
SpringUtil
.
getBean
(
JobTaskRunLogServiceImpl
.
class
);
JobTaskRunLogServiceImpl
mythJobTaskRunLogService
=
SpringUtil
.
getBean
(
JobTaskRunLogServiceImpl
.
class
);
Map
<
String
,
String
>
result
=
new
HashMap
<>(
2
);
Map
<
String
,
String
>
result
=
new
HashMap
<>(
2
);
Object
returnReultObject
=
pluginRpcResponsePacket
.
getResult
();
Object
returnReultObject
=
pluginRpcResponsePacket
.
getResult
();
if
(
returnReultObject
instanceof
ReturnResult
)
{
if
(
returnReultObject
instanceof
ReturnResult
)
{
ReturnResult
returnResult
=
(
ReturnResult
)
returnReultObject
;
ReturnResult
returnResult
=
(
ReturnResult
)
returnReultObject
;
result
.
put
(
CODE
,
returnResult
.
getCode
());
result
.
put
(
CODE
,
returnResult
.
getCode
());
result
.
put
(
MSG
,
returnResult
.
getMsg
());
result
.
put
(
MSG
,
returnResult
.
getMsg
());
}
else
{
}
else
{
result
=
(
Map
<
String
,
String
>)
returnReultObject
;
result
=
(
Map
<
String
,
String
>)
returnReultObject
;
}
}
JobTaskRunLogWithBLOBs
jobTaskRunLog
=
new
JobTaskRunLogWithBLOBs
();
JobTaskRunLogWithBLOBs
jobTaskRunLog
=
new
JobTaskRunLogWithBLOBs
();
String
code
=
result
.
get
(
CODE
);
String
code
=
result
.
get
(
CODE
);
if
(
JobResultEnum
.
SUCCESS
.
getCode
().
equals
(
code
))
{
if
(
JobResultEnum
.
SUCCESS
.
getCode
().
equals
(
code
))
{
code
=
RunResultEnum
.
RUN_SUCCESS
.
getCode
();
code
=
RunResultEnum
.
RUN_SUCCESS
.
getCode
();
}
else
if
(
JobResultEnum
.
DISPATCH_SUCCESS
.
getCode
().
equals
(
code
))
{
}
else
if
(
JobResultEnum
.
DISPATCH_SUCCESS
.
getCode
().
equals
(
code
))
{
code
=
RunResultEnum
.
JOB_RUN_ING
.
getCode
();
code
=
RunResultEnum
.
JOB_RUN_ING
.
getCode
();
}
else
{
}
else
{
code
=
RunResultEnum
.
RUN_ERROR
.
getCode
();
code
=
RunResultEnum
.
RUN_ERROR
.
getCode
();
}
}
String
logUrl
=
pluginRpcResponsePacket
.
getExtension1
();
String
logUrl
=
pluginRpcResponsePacket
.
getExtension1
();
if
(
StringUtils
.
isNoneBlank
(
logUrl
))
{
if
(
StringUtils
.
isNoneBlank
(
logUrl
))
{
jobTaskRunLog
.
setLogRemotelyPath
(
logUrl
);
jobTaskRunLog
.
setLogRemotelyPath
(
logUrl
);
}
}
jobTaskRunLog
.
setRunMsg
(
result
.
get
(
MSG
));
jobTaskRunLog
.
setRunMsg
(
result
.
get
(
MSG
));
jobTaskRunLog
.
setRunCode
(
code
);
jobTaskRunLog
.
setRunCode
(
code
);
jobTaskRunLog
.
setLogId
(
logId
);
jobTaskRunLog
.
setLogId
(
logId
);
jobTaskRunLog
.
setEndTime
(
new
Date
());
jobTaskRunLog
.
setEndTime
(
new
Date
());
String
logPath
=
result
.
get
(
"logPath"
);
if
(
StringUtils
.
isNoneBlank
(
logPath
))
{
jobTaskRunLog
.
setLogRemotelyPath
(
logPath
);
}
mythJobTaskRunLogService
.
updateJobTaskRunLogWithBLOBs
(
jobTaskRunLog
);
mythJobTaskRunLogService
.
updateJobTaskRunLogWithBLOBs
(
jobTaskRunLog
);
}
}
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/TimeoutExampleThreadRunHelper.java
View file @
656a9477
...
@@ -39,6 +39,9 @@ public class TimeoutExampleThreadRunHelper extends BaseThreadRunHelper {
...
@@ -39,6 +39,9 @@ public class TimeoutExampleThreadRunHelper extends BaseThreadRunHelper {
List
<
RunRecording
>
allRunIng
=
runRecordingService
.
findAllRunIng
(
new
FlowConditionDto
());
List
<
RunRecording
>
allRunIng
=
runRecordingService
.
findAllRunIng
(
new
FlowConditionDto
());
List
<
RunRecording
>
timeoutRunRecordings
=
allRunIng
.
stream
().
filter
(
runRecording
->
{
List
<
RunRecording
>
timeoutRunRecordings
=
allRunIng
.
stream
().
filter
(
runRecording
->
{
if
(
runRecording
.
getFlowTimeout
()
<
0
){
return
false
;
}
Date
startDate
=
runRecording
.
getStartTime
();
Date
startDate
=
runRecording
.
getStartTime
();
if
(
startDate
==
null
){
if
(
startDate
==
null
){
return
false
;
return
false
;
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/dto/web/ReturnResult.java
View file @
656a9477
...
@@ -24,6 +24,7 @@ public class ReturnResult<T> implements Serializable {
...
@@ -24,6 +24,7 @@ public class ReturnResult<T> implements Serializable {
public
static
final
ReturnResult
<
String
>
FAIL
=
new
ReturnResult
<>(
JobResultEnum
.
FAIL
.
getCode
(),
JobResultEnum
.
FAIL
.
getMsg
());
public
static
final
ReturnResult
<
String
>
FAIL
=
new
ReturnResult
<>(
JobResultEnum
.
FAIL
.
getCode
(),
JobResultEnum
.
FAIL
.
getMsg
());
private
String
code
;
private
String
code
;
private
String
msg
;
private
String
msg
;
private
String
logPath
=
""
;
/**
/**
* 只是一个介绍,对于类 content 的类型 JSON化
* 只是一个介绍,对于类 content 的类型 JSON化
*/
*/
...
...
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