Auto merge of #1898 - mispencer:DontCacheAvailableCheckErrors, r=micbou

Don't cache invalid completer check results

[Lets try this again](https://github.com/Valloric/YouCompleteMe/pull/1897#issuecomment-170978003)

If the check for available completers isn't run because the server isn't
alive, or the check request erred or times out, don't cache the result. Only
cache valid returns.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1898)
<!-- Reviewable:end -->
This commit is contained in:
Homu 2016-01-13 08:55:32 +09:00
commit aed1d817a4

View File

@ -222,8 +222,13 @@ class YouCompleteMe( object ):
except KeyError: except KeyError:
pass pass
exists_completer = ( self.IsServerAlive() and if not self.IsServerAlive():
bool( SendCompleterAvailableRequest( filetype ) ) ) return False
exists_completer = SendCompleterAvailableRequest( filetype )
if exists_completer is None:
return False
self._available_completers[ filetype ] = exists_completer self._available_completers[ filetype ] = exists_completer
return exists_completer return exists_completer