mirror of
https://github.com/octoleo/syncthing.git
synced 2024-10-02 11:39:01 +00:00
cmd/syncthing: Send Ping events to the disk events API
The Ping event is important, as it means that requests complete within a sensible time. The disk events API didn't have the Ping event, so if there were no disk events, the request would keep taking forever. Unless, of course, there's a reverse proxy which times the request out after a suitably large interval (or something else aborts it), in which case Syncthing isn't very happy. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3929
This commit is contained in:
parent
ee36e2d46d
commit
ddca8d91fa
@ -584,7 +584,7 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
|
|||||||
// events. The LocalChangeDetected event might overwhelm the event
|
// events. The LocalChangeDetected event might overwhelm the event
|
||||||
// receiver in some situations so we will not subscribe to it here.
|
// receiver in some situations so we will not subscribe to it here.
|
||||||
apiSub := events.NewBufferedSubscription(events.Default.Subscribe(events.AllEvents&^events.LocalChangeDetected&^events.RemoteChangeDetected), 1000)
|
apiSub := events.NewBufferedSubscription(events.Default.Subscribe(events.AllEvents&^events.LocalChangeDetected&^events.RemoteChangeDetected), 1000)
|
||||||
diskSub := events.NewBufferedSubscription(events.Default.Subscribe(events.LocalChangeDetected|events.RemoteChangeDetected), 1000)
|
diskSub := events.NewBufferedSubscription(events.Default.Subscribe(events.LocalChangeDetected|events.RemoteChangeDetected|events.Ping), 1000)
|
||||||
|
|
||||||
if len(os.Getenv("GOMAXPROCS")) == 0 {
|
if len(os.Getenv("GOMAXPROCS")) == 0 {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
Loading…
Reference in New Issue
Block a user