Commit 2729bc35 authored by 皮倩雯's avatar 皮倩雯

fix: '增加接口循环调用时间'

parent d92e639f
Pipeline #77092 passed with stages
...@@ -43,8 +43,10 @@ const LookModal = props => { ...@@ -43,8 +43,10 @@ const LookModal = props => {
const fixedVariable = useRef(['昨天', '今天', '上周', '本周', '本月', '上月', '自定义']); const fixedVariable = useRef(['昨天', '今天', '上周', '本周', '本月', '上月', '自定义']);
useEffect(() => { useEffect(() => {
getSiteList(); if (visible) {
getLogList(); getSiteList();
getLogList();
}
}, [visible]); }, [visible]);
const getSiteList = () => { const getSiteList = () => {
......
/* eslint-disable func-names */
/* eslint-disable no-else-return */ /* eslint-disable no-else-return */
/* eslint-disable no-unneeded-ternary */ /* eslint-disable no-unneeded-ternary */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
...@@ -186,29 +187,6 @@ const ScheduledTasks = () => { ...@@ -186,29 +187,6 @@ const ScheduledTasks = () => {
}, []); }, []);
const getIISAgentLog = () => { const getIISAgentLog = () => {
// const worker = new Worker('logWorker.js');
// GetIISAgentLog().then(res => {
// if (res.code === 0) {
// debugger;
// worker.postMessage(res.data);
// worker.onmessage = e => {
// setLogList(e.data);
// debugger;
// scroll.current.scrollTop = scroll.current.scrollHeight;
// timer = setTimeout(() => {
// getIISAgentLog();
// }, 2000);
// };
// } else {
// notification.error({
// message: '提示',
// duration: 3,
// description: res.msg,
// });
// clearInterval(timer);
// timer = null;
// }
// });
GetIISAgentLog().then(res => { GetIISAgentLog().then(res => {
if (res.code === 0) { if (res.code === 0) {
let arr = []; let arr = [];
...@@ -242,7 +220,7 @@ const ScheduledTasks = () => { ...@@ -242,7 +220,7 @@ const ScheduledTasks = () => {
scroll.current.scrollTop = scroll.current.scrollHeight; scroll.current.scrollTop = scroll.current.scrollHeight;
timer = setTimeout(() => { timer = setTimeout(() => {
getIISAgentLog(); getIISAgentLog();
}, 2000); }, 5000);
} else { } else {
notification.error({ notification.error({
message: '提示', message: '提示',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment