Browse Source

Solve the problem of high CPU utilization in some cases
解决一些情况下CPU占用率高的问题

star7th 4 years ago
parent
commit
4b84b644a2
2 changed files with 11 additions and 11 deletions
  1. 1 1
      web_src/src/components/common/Editormd.vue
  2. 10 10
      web_src/static/editor.md/lib/plantuml.js

+ 1 - 1
web_src/src/components/common/Editormd.vue

@@ -253,7 +253,7 @@ export default {
             `${this.editorPath}/lib/sequence-diagram.min.js`,
             `${this.editorPath}/lib/jquery.flowchart.min.js`,
             `${this.editorPath}/lib/jquery.mark.min.js`,
-            `${this.editorPath}/lib/plantuml.js`,
+            `${this.editorPath}/lib/plantuml.js?v=2`,
             `${this.editorPath}/lib/view.min.js`,
             `${this.editorPath}/lib/transform.min.js`
           ],

+ 10 - 10
web_src/static/editor.md/lib/plantuml.js

@@ -1733,14 +1733,14 @@ return function deflate(str, level) {
 
 })();
 
-onmessage = function worker(m) {
-  postMessage(deflate(m.data, 9));
-};
-
-onconnect = function sharedWorker(e) {
-  var port = e.ports[0];
-  port.onmessage = function(m) {
-    port.postMessage(deflate(m.data, 9));
-  };
-};
+// onmessage = function worker(m) {
+//   postMessage(deflate(m.data, 9));
+// };
+
+// onconnect = function sharedWorker(e) {
+//   var port = e.ports[0];
+//   port.onmessage = function(m) {
+//     port.postMessage(deflate(m.data, 9));
+//   };
+// };