lib/model: Refactor encapsulation of the folder scanning

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3017
This commit is contained in:
Lars K.W. Gohlke
2016-06-29 06:37:34 +00:00
committed by Jakob Borg
parent 4bf3e7485b
commit af0bc95de5
11 changed files with 108 additions and 107 deletions

View File

@@ -46,6 +46,13 @@ type stateTracker struct {
changed time.Time
}
func newStateTracker(id string) stateTracker {
return stateTracker{
folderID: id,
mut: sync.NewMutex(),
}
}
// setState sets the new folder state, for states other than FolderError.
func (s *stateTracker) setState(newState folderState) {
if newState == FolderError {