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
924de713
Commit
924de713
authored
Jul 29, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常信息
parent
d0cf908a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
6 deletions
+40
-6
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+1
-0
DaemonScanThreadRunHelperDbLock.java
...ava/com/byit/factory/DaemonScanThreadRunHelperDbLock.java
+2
-1
DaemonScanThreadRunHelperRedisLock.java
.../com/byit/factory/DaemonScanThreadRunHelperRedisLock.java
+2
-1
JavaNodeExecutorTask.java
...ore/src/main/java/com/byit/task/JavaNodeExecutorTask.java
+6
-4
MythLogUtils.java
...-admin-core/src/main/java/com/byit/util/MythLogUtils.java
+29
-0
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
924de713
...
...
@@ -246,6 +246,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
for
(
PluginBaseNode
pluginNode
:
nodeList
){
Node
node
=
new
Node
();
buildNode
(
pluginNode
,
flow
,
node
);
node
.
setNodeId
(
null
);
Integer
nodeId
=
nodeMapper
.
insertSelective
(
node
);
nameIdRel
.
put
(
node
.
getNodeName
(),
node
.
getNodeId
());
}
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/factory/DaemonScanThreadRunHelperDbLock.java
View file @
924de713
package
com
.
byit
.
factory
;
import
com.byit.thread.BaseThreadRunHelper
;
import
com.byit.util.MythLogUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
import
org.springframework.context.annotation.Primary
;
...
...
@@ -71,7 +72,7 @@ public class DaemonScanThreadRunHelperDbLock extends BaseDaemonScanThreadRunHelp
sleepTime
=
examplesValue
.
start
();
}
catch
(
Exception
e
){
if
(!
THREAD_GROUP_STOP
){
e
.
printStackTrace
(
);
log
.
error
(
"-----{}-----"
,
MythLogUtils
.
getMessage
(
e
)
);
}
}
finally
{
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/factory/DaemonScanThreadRunHelperRedisLock.java
View file @
924de713
package
com
.
byit
.
factory
;
import
com.byit.thread.BaseThreadRunHelper
;
import
com.byit.util.MythLogUtils
;
import
com.byit.util.lock.RedissLockUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
...
...
@@ -52,7 +53,7 @@ public class DaemonScanThreadRunHelperRedisLock extends BaseDaemonScanThreadRunH
}
catch
(
Exception
e
)
{
RedissLockUtil
.
unlock
(
lockName
);
if
(!
THREAD_GROUP_STOP
){
log
.
error
(
"---------{}---------"
,
e
.
getMessage
(
));
log
.
error
(
"---------{}---------"
,
MythLogUtils
.
getMessage
(
e
));
}
}
sleepTime
=
sleepTime
==
null
||
sleepTime
<=
0
?
examplesValue
.
UNIVERSAL_WAIT_TIME
:
sleepTime
;
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/task/JavaNodeExecutorTask.java
View file @
924de713
...
...
@@ -14,6 +14,7 @@ import com.byit.service.FastRunLogService;
import
com.byit.service.FlowStatusService
;
import
com.byit.service.impl.JobTaskRunLogServiceImpl
;
import
com.byit.service.impl.RunJavaServiceImpl
;
import
com.byit.util.MythLogUtils
;
import
com.byit.util.ServiceInfoUtil
;
import
com.byit.util.SpringUtil
;
import
io.netty.util.Timeout
;
...
...
@@ -101,17 +102,18 @@ public class JavaNodeExecutorTask implements TimerTask {
}
catch
(
Exception
e
){
if
(
mythJobTaskSchedule
.
getScheduleType
().
equals
(
4
))
{
StringRedisTemplate
stringRedisTemplate
=
(
StringRedisTemplate
)
SpringUtil
.
getBean
(
"stringRedisTemplate"
);
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
true
).
isSuccess
(
false
).
runLog
(
"执行资源异常"
+
e
.
getMessage
(
)).
build
();
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
true
).
isSuccess
(
false
).
runLog
(
"执行资源异常"
+
MythLogUtils
.
getMessage
(
e
)).
build
();
//stringRedisTemplate.convertAndSend("REAL:EXEC:" + mythJobTaskSchedule.getLogId() , JSON.toJSONString(runLog, WriteClassName));
//使用redis 想队尾push一个值
stringRedisTemplate
.
opsForList
().
rightPush
(
"REAL:EXEC:"
+
mythJobTaskSchedule
.
getLogId
()
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
}
log
.
error
(
"------执行机异常{}-----"
,
e
.
getMessage
());
log
.
error
(
"------执行机异常{}-----"
,
MythLogUtils
.
getMessage
(
e
));
assert
jobTaskRunLogById
!=
null
;
jobTaskRunLogById
.
setTriggerCode
(
RunResultEnum
.
TRIGGER_ERROR
.
getCode
());
jobTaskRunLogById
.
setRunCode
(
RunResultEnum
.
RUN_ERROR
.
getCode
());
jobTaskRunLogById
.
setRunMsg
(
mythJobTaskSchedule
.
getNodeName
()+
":"
+
e
.
getMessage
(
));
jobTaskRunLogById
.
setTriggerMsg
(
mythJobTaskSchedule
.
getNodeName
()+
":"
+
e
.
getMessage
(
));
jobTaskRunLogById
.
setRunMsg
(
mythJobTaskSchedule
.
getNodeName
()+
":"
+
MythLogUtils
.
getMessage
(
e
));
jobTaskRunLogById
.
setTriggerMsg
(
mythJobTaskSchedule
.
getNodeName
()+
":"
+
MythLogUtils
.
getMessage
(
e
));
}
jobTaskRunLogService
.
updateJobTaskRunLogWithBLOBs
(
jobTaskRunLogById
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/util/MythLogUtils.java
0 → 100644
View file @
924de713
package
com
.
byit
.
util
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
/**
* @author huangfu
*/
public
class
MythLogUtils
{
/**
* 读取异常信息
* @param obj 异常对象
* @return 返回堆栈异常信息
*/
public
static
String
getMessage
(
Object
obj
)
{
if
(
obj
==
null
)
{
return
""
;
}
if
(
obj
instanceof
Throwable
)
{
StringWriter
str
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
str
);
((
Throwable
)
obj
).
printStackTrace
(
pw
);
return
str
.
toString
();
}
else
{
return
obj
.
toString
();
}
}
}
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