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) {
|
public void onOpen(@PathParam("reportId") String reportId, @PathParam("runMode") String runMode, Session session) {
|
||||||
Timer timer = new Timer(true);
|
Timer timer = new Timer(true);
|
||||||
ApiReportTask task = new ApiReportTask(session, reportId, runMode);
|
ApiReportTask task = new ApiReportTask(session, reportId, runMode);
|
||||||
timer.schedule(task, 0, 1000);
|
timer.schedule(task, 0, 3 * 1000);
|
||||||
refreshTasks.putIfAbsent(session, timer);
|
refreshTasks.putIfAbsent(session, timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,7 @@ export default {
|
||||||
],
|
],
|
||||||
condition: {triggerMode: "", executionStatus: ""},
|
condition: {triggerMode: "", executionStatus: ""},
|
||||||
maintainerOptions: [],
|
maintainerOptions: [],
|
||||||
|
websocket:Object,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -144,11 +145,17 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (hasPermissions('PROJECT_API_SCENARIO:READ')) {
|
if (hasPermissions('PROJECT_API_SCENARIO:READ')) {
|
||||||
this.getTaskRunning();
|
|
||||||
this.condition.executor = getCurrentUser().id;
|
this.condition.executor = getCurrentUser().id;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
watch: {
|
||||||
|
taskVisible(v){
|
||||||
|
if(!v){
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
format(item) {
|
format(item) {
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
|
@ -186,10 +193,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClose(e) {
|
onClose(e) {
|
||||||
if (e.code === 1005) {
|
|
||||||
// 强制删除之后关闭socket,不用刷新report
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
showTaskCenter() {
|
showTaskCenter() {
|
||||||
this.getTaskRunning();
|
this.getTaskRunning();
|
||||||
|
@ -200,6 +203,7 @@ export default {
|
||||||
close() {
|
close() {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.taskVisible = false;
|
this.taskVisible = false;
|
||||||
|
this.websocket.close();
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
this.showTaskCenter();
|
this.showTaskCenter();
|
||||||
|
|
Loading…
Reference in New Issue