mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
lib/model: Check folder context before setting error state (#5416)
This commit is contained in:
parent
9d075781ad
commit
8bb9878f26
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user