Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 3dc0d50

Browse files
committed
Increase diffmatchcpatch timeout
Fixes #1083 Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
1 parent 25e9f61 commit 3dc0d50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

utils/diff/diff.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package diff
88

99
import (
1010
"bytes"
11+
"time"
1112

1213
"github.com/sergi/go-diff/diffmatchpatch"
1314
)
@@ -16,6 +17,7 @@ import (
1617
// string into the dst string.
1718
func Do(src, dst string) (diffs []diffmatchpatch.Diff) {
1819
dmp := diffmatchpatch.New()
20+
dmp.DiffTimeout = time.Hour // the default is time.Second which may be too little under heavy load
1921
wSrc, wDst, warray := dmp.DiffLinesToRunes(src, dst)
2022
diffs = dmp.DiffMainRunes(wSrc, wDst, false)
2123
diffs = dmp.DiffCharsToLines(diffs, warray)

0 commit comments

Comments
 (0)