You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When JS contains a large number of commented code, the CPU is not released due to sandbox regular matching. Is there any good way to remove the commented code?
#130
Open
MrLi2018 opened this issue
Aug 24, 2022
· 1 comment
The JS content is as follows:
//
// return main();
//
// function main() {
// return getResource_name(context.test.data[0]);
// }
//
// function getResource_name(node) {
// var params = {
// resourceType: "test",
// test: {
// logOp: "and",
// test: [{
// name: "type_id",
// operator: "equal",
// value: "5"
// }, {
// name: "test",
// operator: "equal",
// value: node
// }],
// complex: null
// }
// })
// };
// if (isNull(results)) {
// return currentValue;
// }
// var resIdArr=[];
// for (var i in results) {
// resIdArr.push(results[i]);
// }
// return resIdArr[0].test;
// }
//
// function isNull(value) {
// if (value === null || value === undefined) {
// return true;
// }
// var valstr = value.toString();
// if (valstr === 'null' || valstr === 'undefined' || valstr === '' || valstr == '{}' || valstr == '[]') {
// return true;
// }
// return false;
// }
// var LOGPREFIX = '[test] test';
// var phyOrVmList = [];
// try {
// main();
// } catch (e) {
//
// }
// return phyOrVmList;
//
// function main() {
// var neName = context.test.;
// var neName = context.test;
// phyOrVmList = queryPhyVmName('test');
// }
//
// function queryPhyVmName(neName) {
// var params = {
// resourceType: "test",
// selectFields: ["test"]
// };
// params.condition = buildCondition(neName);
// var list = [];
// if (results != null && results != undefined && results.size() > 0) {
// for (var i = 0; i < results.size(); i++) {
// var temp = results.get(i).Value.split(",");
// list = list.concat(temp);
// }
// }
// return list.sort();
// }
//
// function buildCondition(neName) {
// filter: {
// logOp: "and",
// simple: [{
// name: "test",
// operator: "in",
// value: ["test", "test", "test"]
// }, {
// name: "test",
// operator: "equal",
// value: neName
// }, {
// name: "Field",
// operator: "in",
// value: ["test", "test"]
// }],
// complex: null
// }
// });
// }
return ['aa','bb'];
The CPU information is as follows:
Monitoring finds that regular matching is being performed:
The text was updated successfully, but these errors were encountered: