mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
core: judge: bug fix
This commit is contained in:
9 files changed
+20
-23
No files matched your search
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-await-in-loop */
|
||||
import type {
|
||||
Db, Filter, ObjectId, OnlyFieldsOfType,
|
||||
import {
|
||||
BSON, Db, Filter, ObjectId, OnlyFieldsOfType,
|
||||
} from 'mongodb';
|
||||
import pm2 from '@hydrooj/utils/lib/locate-pm2';
|
||||
import type { ProblemSolutionHandler } from '../handler/problem';
|
||||
@@ -111,10 +111,10 @@ try {
|
||||
pm2.launchBus((err, bus) => {
|
||||
if (err) throw new Error();
|
||||
bus.on('hydro:broadcast', (packet) => {
|
||||
(app.parallel as any)(packet.data.event, ...packet.data.payload);
|
||||
(app.parallel as any)(packet.data.event, ...BSON.EJSON.parse(packet.data.payload));
|
||||
});
|
||||
app.on('bus/broadcast', (event, payload) => {
|
||||
process.send({ type: 'hydro:broadcast', data: { event, payload } });
|
||||
process.send({ type: 'hydro:broadcast', data: { event, payload: BSON.EJSON.stringify(payload) } });
|
||||
});
|
||||
console.debug('Using pm2 event bus');
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user