TTS: Invalidate broken file cache entries

If a cached file cannot be read by the TTS component, then it should
be removed from the file cache--or it will remain broken.
This commit is contained in:
Stu Gott 2017-01-20 20:09:03 -05:00
parent 41ee798b0f
commit ec4b148a71

View file

@ -346,6 +346,7 @@ class SpeechManager(object):
try:
data = yield from self.hass.loop.run_in_executor(None, load_speech)
except OSError:
del self.file_cache[key]
raise HomeAssistantError("Can't read {}".format(voice_file))
self._async_store_to_memcache(key, filename, data)