diff --git a/packages/basic.gblib/services/GBVMService.ts b/packages/basic.gblib/services/GBVMService.ts index 8ad1123a..2b4d2fa5 100644 --- a/packages/basic.gblib/services/GBVMService.ts +++ b/packages/basic.gblib/services/GBVMService.ts @@ -273,6 +273,12 @@ export class GBVMService extends GBService { if (Fs.existsSync(filePath)) { connections = JSON.parse(Fs.readFileSync(filePath, 'utf8')); } + const shouldSync = min.core.getParam( + min.instance, + 'Synchronize Database', + false + ); + tableDef.forEach(async t => { const tableName = t.name.trim(); @@ -371,8 +377,8 @@ export class GBVMService extends GBService { equals++; } } - }); + }); if (equals != Object.keys(t.fields).length) { sync = true; @@ -405,7 +411,6 @@ export class GBVMService extends GBService { sync = sync ? sync : !found; - associations.forEach(e => { const from = seq.models[e.from]; const to = seq.models[e.to]; @@ -418,11 +423,6 @@ export class GBVMService extends GBService { }); - const shouldSync = min.core.getParam( - min.instance, - 'Synchronize Database', - false - ); if (sync && shouldSync) { @@ -434,9 +434,6 @@ export class GBVMService extends GBService { }); GBLogEx.info(min, `BASIC: Done sync for ${min.botId} ${connectionName} ${tableName} storage table...`); } - else { - GBLogEx.verbose(min, `BASIC: TABLE ${tableName} keywords already up to date ${connectionName} (${min.botId})...`); - } } }); }