core: fix upgrade script

This commit is contained in:
undefined committed 2023-01-11 19:07:18 +08:00
1 parent 8ddbc8f944
commit d2e18ff3d5
2 files changed
+3 -5

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
/* eslint-disable no-sequences */
import { basename } from 'path';
import { unlinkSync } from 'fs';
import { basename } from 'path';
import { STATUS } from '@hydrooj/utils/lib/status';
import checkers from '../checkers';
import compile, { compileChecker, compileValidator } from '../compile';
+2 -4
View File
@@ -439,10 +439,7 @@ const scripts: UpgradeScript[] = [
);
return true;
},
async function _64_65() {
await system.set('server.center', 'https://hydro.ac/center');
return true;
},
null,
async function _65_66() {
return await iterateAllDomain(async (ddoc) => {
Object.keys(ddoc.roles).forEach((role) => {
@@ -472,6 +469,7 @@ const scripts: UpgradeScript[] = [
endPointForUser,
endPointForJudge,
});
await system.set('db.ver', 67);
await sleep(1000);
logger.info('Upgrade done. please restart the server.');
process.exit(0);