core: fix upgrade script

pull/490/head
undefined 2 years ago
parent 8ddbc8f944
commit d2e18ff3d5

@ -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';

@ -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);

Loading…
Cancel
Save