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

Increase diffmatchcpatch timeout #1084

Merged
merged 2 commits into from
Mar 20, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions utils/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package diff

import (
"bytes"
"time"

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