fix(basic.gblib): Allow MERGE keyword in storage #380. @othonlima

This commit is contained in:
Rodrigo Rodriguez 2023-12-02 12:25:43 -03:00
parent 4ff3cbafd5
commit 540e275d65
2 changed files with 14 additions and 4 deletions

View file

@ -314,7 +314,7 @@ export class GBVMService extends GBService {
const sequelizeOptions = {
define: {
charset: 'utf8',
collate: 'utf8_general_ci',
collate: 'utf8_general_ci',
freezeTableName: true,
timestamps: false
},
@ -326,7 +326,8 @@ export class GBVMService extends GBService {
dialectOptions: {
options: {
trustServerCertificate: true,
encrypt: encrypt
encrypt: encrypt,
requestTimeout: 120 * 1000
}
},
pool: {

View file

@ -659,7 +659,7 @@ export class SystemKeywords {
*/
public async saveToStorageBatch({ pid, table, rows }): Promise<void> {
const { min } = await DialogKeywords.getProcessInfo(pid);
GBLog.info(`BASIC: Saving to storage '${table}' (SAVE).`);
GBLog.info(`BASIC: Saving batch to storage '${table}' (SAVE).`);
const definition = this.getTableFromName(table, min);
@ -2056,7 +2056,16 @@ export class SystemKeywords {
header = Object.keys(t.fieldRawAttributesMap);
if (!this.cachedMerge[pid][file]) {
rows = await t.findAll({});
await retry(
async (bail) => {
rows = await t.findAll({});
},
{
retries: 5,
onRetry: (err) => { GBLog.error(`MERGE: Retrying SELECT ALL on table: ${err.message}.`); }
}
);
}
else {
rows = this.cachedMerge[pid][file];