syncthing/lib/model
Jakob Borg d6fbfc3545 lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965)
The folder already knew how to stop properly, but the fs.Walk() didn't
and can potentially take a very long time. This adds context support to
Walk and the underlying scanning stuff, and passes in an appropriate
context from above. The stop channel in model.folder is replaced with a
context for this purpose.

To test I added an infiniteFS that represents a large amount of data
(not actually infinite, but close) and verify that walking it is
properly stopped. For that to be implemented smoothly I moved out the
Walk function to it's own type, as typically the implementer of a new
filesystem type might not need or want to reimplement Walk.

It's somewhat tricky to test that this actually works properly on the
actual sendReceiveFolder and so on, as those are started from inside the
model and the filesystem isn't easily pluggable etc. Instead I've tested
that part manually by adding a huge folder and verifying that pause,
resume and reconfig do the right things by looking at debug output.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4117
2017-04-26 00:15:23 +00:00
..
testdata lib/model: Temp names from all platforms should be recognized as such 2016-11-30 21:23:24 +00:00
.gitignore mv internal lib 2015-08-09 09:35:26 +02:00
debug.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
deviceactivity.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
deviceactivity_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
devicedownloadstate.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
devicedownloadstate_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
doc.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
folder.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
folderscanner.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
folderstate.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
model.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
model_test.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
progressemitter.go all: Correct various typos 2017-02-25 08:12:13 +00:00
progressemitter_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
queue.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
queue_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
requests_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
rofolder.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
rwfolder.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
rwfolder_test.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
sentdownloadstate.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
sharedpullerstate.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
sharedpullerstate_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
sorter.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
sorter_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
util.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00