Enqueue text to speech task after creating article

This commit is contained in:
Hongbo Wu
2022-08-16 22:16:43 +08:00
parent 447e413605
commit c74f2bc3fd

View File

@ -94,6 +94,7 @@ import {
updatePage,
} from '../../elastic/pages'
import { searchHighlights } from '../../elastic/highlights'
import { enqueueTextToSpeech } from '../../utils/createTask'
export type PartialArticle = Omit<
Article,
@ -372,6 +373,10 @@ export const createArticleResolver = authorized<
articleToSave.id = newPageId
}
// enqueue a task to convert text to speech
const taskName = await enqueueTextToSpeech(uid, articleToSave.id)
log.info('Text to speech task name', { taskName })
log.info(
'page created in elastic',
articleToSave.id,