cmd/syncthing: Start CPU usage monitoring not from init (fixes #4183)
Starting stuff from init() is an antipattern, and the innerProcess variable isn't 100% reliable. We should sort out the other uses of it as well in due time. Also removing the hack on innerProcess as I happened to see it and the affected versions are now <1% users. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4185
This commit is contained in:
committed by
Audrius Butkevicius
parent
b49bbe82dd
commit
803da92ca9
13
cmd/syncthing/mocked_cpuusage_test.go
Normal file
13
cmd/syncthing/mocked_cpuusage_test.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright (C) 2017 The Syncthing Authors.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
// You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
package main
|
||||
|
||||
type mockedCPUService struct{}
|
||||
|
||||
func (*mockedCPUService) Rate() float64 {
|
||||
return 42
|
||||
}
|
||||
Reference in New Issue
Block a user