mirror of
https://github.com/syncthing/syncthing.git
synced 2026-01-06 12:59:20 -05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d3f8a2c06 | ||
|
|
b1ba976122 |
5
auto/gui.files.go
Normal file
5
auto/gui.files.go
Normal file
File diff suppressed because one or more lines are too long
2
build.sh
2
build.sh
@@ -11,7 +11,7 @@ fi
|
||||
if [[ -z $1 ]] ; then
|
||||
go build -ldflags "-X main.Version $version"
|
||||
elif [[ $1 == "embed" ]] ; then
|
||||
embedder main gui > gui.files.go \
|
||||
embedder auto gui > auto/gui.files.go \
|
||||
&& go build -ldflags "-X main.Version $version"
|
||||
elif [[ $1 == "tar" ]] ; then
|
||||
go build -ldflags "-X main.Version $version" \
|
||||
|
||||
@@ -20,7 +20,7 @@ type Options struct {
|
||||
ExternalServer string `ini:"global-announce-server" default:"syncthing.nym.se:22025" description:"Global server for announcements"`
|
||||
ExternalDiscovery bool `ini:"global-announce-enabled" default:"true" description:"Announce to the global announce server"`
|
||||
LocalDiscovery bool `ini:"local-announce-enabled" default:"true" description:"Announce to the local network"`
|
||||
RequestsInFlight int `ini:"parallell-requests" default:"16" description:"Maximum number of blocks to request in parallell"`
|
||||
ParallelRequests int `ini:"parallel-requests" default:"16" description:"Maximum number of blocks to request in parallel"`
|
||||
LimitRate int `ini:"max-send-kbps" description:"Limit outgoing data rate (kbyte/s)"`
|
||||
ScanInterval time.Duration `ini:"rescan-interval" default:"60s" description:"Scan repository for changes this often"`
|
||||
ConnInterval time.Duration `ini:"reconnection-interval" default:"60s" description:"Attempt to (re)connect to peers this often"`
|
||||
|
||||
File diff suppressed because one or more lines are too long
3
gui.go
3
gui.go
@@ -11,6 +11,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/calmh/syncthing/auto"
|
||||
"github.com/calmh/syncthing/model"
|
||||
"github.com/codegangsta/martini"
|
||||
"github.com/cratonica/embed"
|
||||
@@ -26,7 +27,7 @@ func startGUI(addr string, m *model.Model) {
|
||||
router.Get("/rest/need", restGetNeed)
|
||||
router.Get("/rest/system", restGetSystem)
|
||||
|
||||
fs, err := embed.Unpack(Resources)
|
||||
fs, err := embed.Unpack(auto.Resources)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
2
main.go
2
main.go
@@ -210,7 +210,7 @@ func main() {
|
||||
infoln("Deletes from peer nodes will be ignored")
|
||||
}
|
||||
okln("Ready to synchronize (read-write)")
|
||||
m.StartRW(opts.Delete, opts.RequestsInFlight)
|
||||
m.StartRW(opts.Delete, opts.ParallelRequests)
|
||||
} else {
|
||||
okln("Ready to synchronize (read only; no external updates accepted)")
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ type Model struct {
|
||||
|
||||
sup suppressor
|
||||
|
||||
parallellRequests int
|
||||
limitRequestRate chan struct{}
|
||||
parallelRequests int
|
||||
limitRequestRate chan struct{}
|
||||
|
||||
imut sync.Mutex // protects Index
|
||||
}
|
||||
@@ -130,7 +130,7 @@ func (m *Model) StartRW(del bool, threads int) {
|
||||
|
||||
m.rwRunning = true
|
||||
m.delete = del
|
||||
m.parallellRequests = threads
|
||||
m.parallelRequests = threads
|
||||
|
||||
go m.cleanTempFiles()
|
||||
if del {
|
||||
@@ -491,7 +491,7 @@ func (m *Model) AddConnection(rawConn io.Closer, protoConn Connection) {
|
||||
return
|
||||
}
|
||||
|
||||
for i := 0; i < m.parallellRequests; i++ {
|
||||
for i := 0; i < m.parallelRequests; i++ {
|
||||
i := i
|
||||
go func() {
|
||||
if m.trace["pull"] {
|
||||
|
||||
Reference in New Issue
Block a user