fix(任务中心): 优化任务中心同步频率,当关闭窗口后停止关闭检测
This commit is contained in:
parent
77c2132245
commit
4fd31e7e74
|
@ -33,7 +33,7 @@ public class ApiReportWebSocket {
|
|||
public void onOpen(@PathParam("reportId") String reportId, @PathParam("runMode") String runMode, Session session) {
|
||||
Timer timer = new Timer(true);
|
||||
ApiReportTask task = new ApiReportTask(session, reportId, runMode);
|
||||
timer.schedule(task, 0, 1000);
|
||||
timer.schedule(task, 0, 3 * 1000);
|
||||
refreshTasks.putIfAbsent(session, timer);
|
||||
}
|
||||
|
||||
|
|
|
@ -137,6 +137,7 @@ export default {
|
|||
],
|
||||
condition: {triggerMode: "", executionStatus: ""},
|
||||
maintainerOptions: [],
|
||||
websocket:Object,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -144,9 +145,15 @@ export default {
|
|||
},
|
||||
created() {
|
||||
if (hasPermissions('PROJECT_API_SCENARIO:READ')) {
|
||||
this.getTaskRunning();
|
||||
this.condition.executor = getCurrentUser().id;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
taskVisible(v){
|
||||
if(!v){
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
format(item) {
|
||||
|
@ -186,10 +193,6 @@ export default {
|
|||
}
|
||||
},
|
||||
onClose(e) {
|
||||
if (e.code === 1005) {
|
||||
// 强制删除之后关闭socket,不用刷新report
|
||||
return;
|
||||
}
|
||||
},
|
||||
showTaskCenter() {
|
||||
this.getTaskRunning();
|
||||
|
@ -200,6 +203,7 @@ export default {
|
|||
close() {
|
||||
this.visible = false;
|
||||
this.taskVisible = false;
|
||||
this.websocket.close();
|
||||
},
|
||||
open() {
|
||||
this.showTaskCenter();
|
||||
|
|
Loading…
Reference in New Issue