mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
parent
2383579a64
commit
a2da31056b
@ -115,7 +115,9 @@ The following enviroment variables are interpreted by syncthing:
|
|||||||
|
|
||||||
STCPUPROFILE Write CPU profile to the specified file.
|
STCPUPROFILE Write CPU profile to the specified file.
|
||||||
|
|
||||||
STGUIASSETS Directory to load GUI assets from. Overrides compiled in assets.`
|
STGUIASSETS Directory to load GUI assets from. Overrides compiled in assets.
|
||||||
|
|
||||||
|
STDEADLOCKTIMEOUT Alter deadlock detection timeout (seconds; default 1200).`
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -13,6 +13,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -97,9 +98,16 @@ func NewModel(indexDir string, cfg *config.Configuration, clientName, clientVers
|
|||||||
sup: suppressor{threshold: int64(cfg.Options.MaxChangeKbps)},
|
sup: suppressor{threshold: int64(cfg.Options.MaxChangeKbps)},
|
||||||
}
|
}
|
||||||
|
|
||||||
deadlockDetect(&m.rmut, 60*time.Second)
|
var timeout = 20 * 60 // seconds
|
||||||
deadlockDetect(&m.smut, 60*time.Second)
|
if t := os.Getenv("STDEADLOCKTIMEOUT"); len(t) > 0 {
|
||||||
deadlockDetect(&m.pmut, 60*time.Second)
|
it, err := strconv.Atoi(t)
|
||||||
|
if err == nil {
|
||||||
|
timeout = it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
deadlockDetect(&m.rmut, time.Duration(timeout)*time.Second)
|
||||||
|
deadlockDetect(&m.smut, time.Duration(timeout)*time.Second)
|
||||||
|
deadlockDetect(&m.pmut, time.Duration(timeout)*time.Second)
|
||||||
go m.broadcastIndexLoop()
|
go m.broadcastIndexLoop()
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user