lib/sync: Fix broken build

This commit is contained in:
Audrius Butkevicius
2016-11-05 02:31:52 +00:00
parent da413b823b
commit caaab462bc
2 changed files with 7 additions and 4 deletions

View File

@@ -12,8 +12,8 @@ import (
"strings"
"time"
"github.com/syncthing/syncthing/lib/logger"
"github.com/sasha-s/go-deadlock"
"github.com/syncthing/syncthing/lib/logger"
)
var (
@@ -31,7 +31,10 @@ func init() {
l.SetDebug("sync", strings.Contains(os.Getenv("STTRACE"), "sync") || os.Getenv("STTRACE") == "all")
if n, err := strconv.Atoi(os.Getenv("STLOCKTHRESHOLD")); err == nil {
deadlock.Opts.DeadlockTimeout = threshold = time.Duration(n) * time.Millisecond
threshold = time.Duration(n) * time.Millisecond
}
if n, err := strconv.Atoi(os.Getenv("STDEADLOCK")); err == nil {
deadlock.Opts.DeadlockTimeout = time.Duration(n) * time.Second
}
l.Debugf("Enabling lock logging at %v threshold", threshold)
}