Explorar o código

Set the diff-match-patch timeout to 100ms

This might result in worse diffs, but we don't want to spend a second
blocking the event loop while we figure out nicer diffs when comparing
documents.
Eric Mc Sween %!s(int64=5) %!d(string=hai) anos
pai
achega
98f8d7f51c
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      services/document-updater/app/js/DiffCodec.js

+ 3 - 0
services/document-updater/app/js/DiffCodec.js

@@ -1,6 +1,9 @@
 const DMP = require('diff-match-patch')
 const dmp = new DMP()
 
+// Do not attempt to produce a diff for more than 100ms
+dmp.Diff_Timeout = 0.1
+
 module.exports = {
   ADDED: 1,
   REMOVED: -1,