Amy0104 commented on code in PR #11226:
URL: https://github.com/apache/dolphinscheduler/pull/11226#discussion_r985313877
##########
dolphinscheduler-ui/src/views/projects/task/instance/batch-task.tsx:
##########
@@ -74,20 +77,27 @@ const BatchTaskInstance = defineComponent({
variables.showModalRef = false
}
- const getLogs = (row: any) => {
+ const getLogs = (row: any, logTimer: number) => {
const { state } = useAsyncState(
queryLog({
taskInstanceId: Number(row.id),
limit: variables.limit,
skipLineNum: variables.skipLineNum
}).then((res: any) => {
- if (res?.message) {
- variables.logRef += res.message
+ variables.logRef += res.message || ''
+ if (res && res.message !== '') {
variables.limit += 1000
variables.skipLineNum += res.lineNum
- getLogs(row)
+ getLogs(row, logTimer)
} else {
variables.logLoadingRef = false
+ setTimeout(() => {
+ variables.logRef = ''
+ variables.limit = 1000
+ variables.skipLineNum = 0
+ variables.logLoadingRef = true
+ getLogs(row, logTimer)
+ }, logTimer * 1000)
Review Comment:
If the `getLogs` function is called multiple times, multiple timers will be
running.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]