diff --git a/shell/task.sh b/shell/task.sh index 0b4529bf..7ac37476 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -165,4 +165,6 @@ main () { esac } -main "$@" \ No newline at end of file +main "$@" + +exit 0 diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 7e97522c..9a01e5dc 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -385,6 +385,7 @@ const Crontab = () => { useEffect(() => { if (logCron) { + localStorage.setItem('logCron', logCron._id); setIsLogModalVisible(true); } }, [logCron]); diff --git a/src/pages/crontab/logModal.tsx b/src/pages/crontab/logModal.tsx index 17fbc423..a5323890 100644 --- a/src/pages/crontab/logModal.tsx +++ b/src/pages/crontab/logModal.tsx @@ -28,12 +28,14 @@ const CronLogModal = ({ request .get(`${config.apiPrefix}crons/${cron._id}/log`) .then((data: any) => { - const log = data.data as string; - setValue(log || '暂无日志'); - if (log && !log.includes('执行结束')) { - setTimeout(() => { - getCronLog(); - }, 2000); + if (localStorage.getItem('logCron') === cron._id) { + const log = data.data as string; + setValue(log || '暂无日志'); + if (log && !log.includes('执行结束')) { + setTimeout(() => { + getCronLog(); + }, 2000); + } } }) .finally(() => {