fix(security.gbalib): Transfer issues fixed.

This commit is contained in:
Rodrigo Rodriguez 2021-12-08 15:24:06 -03:00
parent 64d9884b69
commit 660faafb53
2 changed files with 8 additions and 7 deletions

View file

@ -831,9 +831,11 @@ export class GBDeployer implements IGBDeployer {
express.static(urlJoin('work', gbaiName, filename, 'audios')));
GBServer.globals.server.use(`/kb/${gbaiName}/${packageName}/videos`,
express.static(urlJoin('work', gbaiName, filename, 'videos')));
GBServer.globals.server.use(`/${botId}/cache`,
GBServer.globals.server.use(`/${botId}/cache`,
express.static(urlJoin('work', gbaiName, 'cache')));
GBServer.globals.server.use(`/${gbaiName}/${botId}.gbdata/public`,
express.static(urlJoin('work', gbaiName, `${botId}.gbdata`, 'public')));
GBLog.info(`KB (.gbkb) assets accessible at: /kb/${botId}.gbai/${packageName}.`);

View file

@ -193,16 +193,15 @@ export class SecService extends GBService {
const list = process.env.TRANSFER_TO.split(';');
await CollectionUtil.asyncForEach(list, async item => {
if (
!(await this.isAgentSystemId(item)) &&
item !== undefined &&
agentSystemId === undefined &&
item !== userSystemId
!(item !== undefined &&
agentSystemId === undefined &&
item !== userSystemId && await this.isAgentSystemId(item))
) {
// TODO: Optimize loop.
agentSystemId = item;
}
});
await this.updateHumanAgent(userSystemId, instanceId, agentSystemId);
return agentSystemId;