mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
kill only after 2s
This commit is contained in:
@@ -100,21 +100,20 @@ class TaskGather extends Task {
|
|||||||
try {
|
try {
|
||||||
if (this.sayTask) {
|
if (this.sayTask) {
|
||||||
this.logger.debug('Gather: kicking off say task');
|
this.logger.debug('Gather: kicking off say task');
|
||||||
this.sayTask.exec(cs, ep).then(() => {
|
this.sayTask.exec(cs, ep);
|
||||||
this.logger.debug('Gather: completed say task promise');
|
|
||||||
if (!this.killed) {
|
|
||||||
if (this.listenAfterSpeech) {
|
|
||||||
startListening(cs, ep);
|
|
||||||
} else {
|
|
||||||
this.kill(cs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}).catch(err => this.logger.error({err}, 'Gather: failed to play say task')); // kicked off, _not_ waiting for it to complete
|
|
||||||
this.sayTask.on('playDone', async(err) => {
|
this.sayTask.on('playDone', async(err) => {
|
||||||
if (err) return this.logger.error({err}, 'Gather:exec Error playing tts');
|
if (err) return this.logger.error({err}, 'Gather:exec Error playing tts');
|
||||||
this.logger.debug('Gather: say task completed');
|
this.logger.debug('Gather: say task completed');
|
||||||
|
if (!this.killed) {
|
||||||
|
if (this.listenAfterSpeech) {
|
||||||
|
startListening(cs, ep);
|
||||||
|
} else {
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.kill(cs);
|
||||||
|
},2000)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (this.playTask) {
|
else if (this.playTask) {
|
||||||
|
|||||||
Reference in New Issue
Block a user