fix(all): Fix search on others bots than boot.
This commit is contained in:
parent
5812b59bb4
commit
e7a7b41531
1 changed files with 14 additions and 10 deletions
|
@ -585,16 +585,6 @@ export class KBService implements IGBKBService {
|
|||
}
|
||||
});
|
||||
|
||||
await GuaribasQuestion.destroy({
|
||||
where: { instanceId: min.instance.instanceId }
|
||||
});
|
||||
await GuaribasAnswer.destroy({
|
||||
where: { instanceId: min.instance.instanceId }
|
||||
});
|
||||
await GuaribasSubject.destroy({
|
||||
where: { instanceId: min.instance.instanceId}
|
||||
});
|
||||
|
||||
const answersCreated = await GuaribasAnswer.bulkCreate(answers);
|
||||
|
||||
let i = 0;
|
||||
|
@ -677,6 +667,20 @@ export class KBService implements IGBKBService {
|
|||
const subjectFile = urlJoin(localPath, 'subjects.json');
|
||||
const menuFile = urlJoin(localPath, 'menu.xlsx');
|
||||
|
||||
// Bot KB store clean up.
|
||||
|
||||
await GuaribasQuestion.destroy({
|
||||
where: { instanceId: min.instance.instanceId }
|
||||
});
|
||||
await GuaribasAnswer.destroy({
|
||||
where: { instanceId: min.instance.instanceId }
|
||||
});
|
||||
await GuaribasSubject.destroy({
|
||||
where: { instanceId: min.instance.instanceId}
|
||||
});
|
||||
|
||||
// Imports menu.xlsx if any.
|
||||
|
||||
if (Fs.existsSync(subjectFile) || Fs.existsSync(menuFile)) {
|
||||
await this.importSubjectFile(packageStorage.packageId, subjectFile, menuFile, instance);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue