diff --git a/hugvey/story.py b/hugvey/story.py index 7ac1964..07a753b 100644 --- a/hugvey/story.py +++ b/hugvey/story.py @@ -143,11 +143,12 @@ class Message(object): self.variableValues[name] = value self.logger.warn(f"Set variable, fetch {name}") - if not None in self.variableValues.values(): - self.logger.warn(f"now fetch {name} for {self.id}") - asyncio.get_event_loop().create_task(self.getAudioFilePath()) -# asyncio.get_event_loop().call_soon_threadsafe(self.getAudioFilePath) -# self.logger.warn(f"started {name}") + # disable prefetching of audio files, to avoid a bunch of calls at once to the voice api's + # Other possiblity would be to wrap getAudioFilePath() into a method that delays execution incrementally + # with an asyncio.sleep(i) +# if not None in self.variableValues.values(): +# self.logger.warn(f"now fetch {name} for {self.id}") +# asyncio.get_event_loop().create_task(self.getAudioFilePath()) def getVariableValue(self, var): return self.variableValues[var] if (self.variableValues[var] is not None) else self.story.configuration.nothing_text #TODO: translate nothing to each language