Create speech while requesting

This commit is contained in:
Hongbo Wu
2022-08-17 10:51:39 +08:00
parent 301746d494
commit b0bf4fc5ce
4 changed files with 45 additions and 8 deletions

View File

@ -337,7 +337,15 @@ export const enqueueTextToSpeech = async (
// If there is no Google Cloud Project Id exposed, it means that we are in local environment
if (env.dev.isLocal || !GOOGLE_CLOUD_PROJECT) {
return nanoid()
// Calling the handler function directly.
setTimeout(() => {
axios
.post(env.queue.textToSpeechTaskHandlerUrl, payload)
.catch((error) => {
logger.error(error)
})
}, 0)
return ''
}
const createdTasks = await createHttpTaskWithToken({