mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
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:
parent
41ee798b0f
commit
ec4b148a71
@ -346,6 +346,7 @@ class SpeechManager(object):
|
|||||||
try:
|
try:
|
||||||
data = yield from self.hass.loop.run_in_executor(None, load_speech)
|
data = yield from self.hass.loop.run_in_executor(None, load_speech)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
del self.file_cache[key]
|
||||||
raise HomeAssistantError("Can't read {}".format(voice_file))
|
raise HomeAssistantError("Can't read {}".format(voice_file))
|
||||||
|
|
||||||
self._async_store_to_memcache(key, filename, data)
|
self._async_store_to_memcache(key, filename, data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user