core: fix

This commit is contained in:
undefined committed 2021-04-04 18:23:45 +08:00
1 parent 8a8da0fba4
commit fb47598c57
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.21.4",
"version": "2.21.5",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+2 -2
View File
@@ -68,10 +68,10 @@ export async function load(call: Entry) {
storage.start(sopts);
require('../service/monitor');
for (const i of builtinModel) require(`../model/${i}`);
const scripts = require('../upgrade');
const scripts = require('../upgrade').default;
let dbVer = (await modelSystem.get('db.ver')) ?? 0;
const isFresh = !dbVer;
const expected = scripts.default.length;
const expected = scripts.length;
while (dbVer < expected) {
logger.info('Upgrading database: from %d to %d', dbVer, expected);
if (isFresh) {