mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
judge: refactor: use common JudgeTask interface
This commit is contained in:
1 parent
e2d8df1428
commit
636446c43a
20 files changed
+291
-506
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user