judge: refactor: use common JudgeTask interface

This commit is contained in:
undefined committed 2022-09-06 13:02:46 +08:00
1 parent e2d8df1428
commit 636446c43a
20 files changed
+291 -506

No files matched your search

+2 -2
View File
@@ -16,7 +16,7 @@
import './utils';
import { getConfig } from './config';
import * as Session from './hosts/index';
import HydroHost from './hosts/hydro';
import log from './log';
import { Queue } from './utils';
@@ -65,7 +65,7 @@ async function daemon() {
worker(queue).catch((e) => log.error(e));
for (const i in _hosts) {
_hosts[i].host = _hosts[i].host || i;
hosts[i] = new Session[_hosts[i].type || 'hydro'](_hosts[i]);
hosts[i] = new HydroHost(_hosts[i]);
await hosts[i].init();
}
for (const i in hosts) hosts[i].consume(queue);