mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: check isFunction for script
This commit is contained in:
1 parent
0d86bd9ddc
commit
30f82ae82b
2 files changed
+7
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.21.15",
|
||||
"version": "2.21.16",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
Reference in new issue
Block a user