fix(basic.gblib): Fix Scheduling.
This commit is contained in:
parent
0451c4ca31
commit
1a5f76f2ac
1 changed files with 7 additions and 10 deletions
|
@ -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<boolean>(
|
||||
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<boolean>(
|
||||
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})...`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue