core: check isFunction for script

This commit is contained in:
undefined committed 2021-04-07 16:10:12 +08:00
1 parent 0d86bd9ddc
commit 30f82ae82b
2 files changed
+7 -3

No files matched your search

+6 -2
View File
@@ -75,8 +75,12 @@ export async function load(call: Entry) {
while (dbVer < expected) {
logger.info('Upgrading database: from %d to %d', dbVer, expected);
const func = scripts[dbVer];
if (typeof func !== 'function') {
dbVer++;
continue;
}
if (isFresh) {
if (typeof func !== 'function' || func.toString().includes('_FRESH_INSTALL_IGNORE')) {
if (func.toString().includes('_FRESH_INSTALL_IGNORE')) {
dbVer++;
continue;
}
@@ -86,6 +90,6 @@ export async function load(call: Entry) {
dbVer++;
await modelSystem.set('db.ver', dbVer);
}
bus.serial('app/started');
await bus.serial('app/started');
return await modelSystem.get('server.worker');
}