mirror of
https://github.com/atom/atom.git
synced 2026-02-10 06:35:00 -05:00
Terminate all directory searches if any fail
@bolinfest: I was seeing exceptions after the test terminated due to one of the searches still running. I think since the promise rejects with “all” semantics that we should cancel any other searches when one fails. I wouldn’t expect them to continue if the promise is no longer unresolved.
This commit is contained in:
@@ -904,7 +904,12 @@ class Workspace extends Model
|
||||
resolve('cancelled')
|
||||
else
|
||||
resolve(null)
|
||||
searchPromise.then(onSuccess, reject)
|
||||
|
||||
onFailure = ->
|
||||
promise.cancel() for promise in allSearches
|
||||
reject()
|
||||
|
||||
searchPromise.then(onSuccess, onFailure)
|
||||
cancellablePromise.cancel = ->
|
||||
isCancelled = true
|
||||
# Note that cancelling all of the members of allSearches will cause all of the searches
|
||||
|
||||
Reference in New Issue
Block a user