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
2def2fbc
Commit
2def2fbc
authored
May 11, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改redis发布订阅模式的模式 改为redis 数组模式 尾部插入
parent
b9f1f019
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
ScriptExecutorJobTask.java
...re/src/main/java/com/byit/task/ScriptExecutorJobTask.java
+3
-1
MythJobProcess.java
...server/src/main/java/com/byit/process/MythJobProcess.java
+3
-1
LogGobbler.java
...cutor-server/src/main/java/com/byit/utils/LogGobbler.java
+4
-1
ErrorHandlerController.java
...a/com/byit/gateway/controller/ErrorHandlerController.java
+0
-1
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/task/ScriptExecutorJobTask.java
View file @
2def2fbc
...
...
@@ -110,7 +110,9 @@ public class ScriptExecutorJobTask implements TimerTask {
}
catch
(
Exception
e
){
StringRedisTemplate
stringRedisTemplate
=
(
StringRedisTemplate
)
SpringUtil
.
getBean
(
"stringRedisTemplate"
);
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
true
).
isSuccess
(
false
).
runLog
(
"执行资源异常"
+
e
.
getMessage
()).
build
();
stringRedisTemplate
.
convertAndSend
(
"REAL-EXEC-"
+
mythJobTaskSchedule
.
getLogId
()
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
//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
());
dispatchResponseDto
.
setMsg
(
e
.
getMessage
());
dispatchResponseDto
.
setCode
(
JobResultEnum
.
DISPATCH_FAIL
.
getCode
());
...
...
byit-myth-executor/myth-executor-server/src/main/java/com/byit/process/MythJobProcess.java
View file @
2def2fbc
...
...
@@ -154,7 +154,9 @@ public class MythJobProcess implements Callable<String>{
this
.
process
.
destroy
();
}
RunLog
runLog
=
RunLog
.
builder
().
isEnd
(
true
).
isSuccess
(
exitCode
==
0
?
true
:
false
).
build
();
stringRedisTemplate
.
convertAndSend
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
//stringRedisTemplate.convertAndSend(runKey, JSON.toJSONString(runLog, WriteClassName))
//TODO 向队尾追加一个日志
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
return
outputGobbler
.
getRecentLog
()
+
"\n"
+
errorGobbler
.
getRecentLog
();
}
}
...
...
byit-myth-executor/myth-executor-server/src/main/java/com/byit/utils/LogGobbler.java
View file @
2def2fbc
...
...
@@ -44,7 +44,10 @@ public class LogGobbler extends Thread {
}
this
.
buffer
.
append
(
line
+
"\n"
);
runLog
.
setRunLog
(
line
);
stringRedisTemplate
.
convertAndSend
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
//stringRedisTemplate.convertAndSend(runKey, JSON.toJSONString(runLog, WriteClassName))
//TODO 向队列队尾插入一个值
stringRedisTemplate
.
opsForList
().
rightPush
(
runKey
,
JSON
.
toJSONString
(
runLog
,
WriteClassName
));
printLog
(
line
);
}
}
catch
(
final
IOException
e
)
{
...
...
byit-myth-gateway/src/main/java/com/byit/gateway/controller/ErrorHandlerController.java
View file @
2def2fbc
...
...
@@ -5,7 +5,6 @@ import com.byit.enums.TransferResultEnum;
import
com.netflix.zuul.context.RequestContext
;
import
com.netflix.zuul.exception.ZuulException
;
import
org.springframework.boot.autoconfigure.web.ErrorController
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
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