mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
add support for config migration
This commit is contained in:
14 files changed
+206
-151
No files matched your search
@@ -189,6 +189,8 @@ class VJudgeService extends Service {
|
||||
private providers: Record<string, any> = {};
|
||||
private pool: Record<string, AccountService> = {};
|
||||
async [Service.setup]() {
|
||||
if (process.env.NODE_APP_INSTANCE !== '0') return;
|
||||
if (process.env.HYDRO_CLI) return;
|
||||
this.accounts = await coll.find().toArray();
|
||||
this.ctx.setInterval(this.sync.bind(this), Time.week);
|
||||
}
|
||||
@@ -258,9 +260,9 @@ export * from './interface';
|
||||
|
||||
export const name = 'vjudge';
|
||||
export async function apply(ctx: Context) {
|
||||
ctx.plugin(VJudgeService);
|
||||
if (process.env.NODE_APP_INSTANCE !== '0') return;
|
||||
if (process.env.HYDRO_CLI) return;
|
||||
ctx.plugin(VJudgeService);
|
||||
ctx.inject(['migration'], async (c) => {
|
||||
c.migration.registerChannel('vjudge', [
|
||||
async function init() { }, // eslint-disable-line
|
||||
|
||||
Reference in new issue
Block a user