judge: fix #116 (problem_rejudge)

This commit is contained in:
undefined committed 2021-04-26 12:31:25 +08:00
1 parent 0e9fdca8cd
commit b8e03f28ea
2 files changed
+5 -4

No files matched your search

+4 -3
View File
@@ -231,9 +231,10 @@ export default class Hydro {
this.ws.on('open', () => {
this.ws.send(this.config.cookie);
global.onDestory.push(() => this.ws.close());
setInterval(() => {
this.ws.send(`{"key":"prio","prio":${this.config.minPriority || -50}}`);
}, 30000);
const content = this.config.minPriority !== undefined
? `{"key":"prio","prio":${this.config.minPriority}}`
: '{"key":"ping"}';
setInterval(() => this.ws.send(content), 30000);
});
this.ws.on('message', (data) => {
const request = JSON.parse(data.toString());