lib/model: Check folder context before setting error state (#5416)

This commit is contained in:
Simon Frei 2018-12-30 21:56:16 +01:00 committed by Jakob Borg
parent 9d075781ad
commit 8bb9878f26

View File

@ -653,6 +653,12 @@ func (f *folder) startWatchAsync(ctx context.Context, ignores *ignore.Matcher) {
}
func (f *folder) setError(err error) {
select {
case <-f.ctx.Done():
return
default:
}
_, _, oldErr := f.getState()
if (err != nil && oldErr != nil && oldErr.Error() == err.Error()) || (err == nil && oldErr == nil) {
return