From b8e03f28eabab53d099d47d8d87ec679abe1c7a1 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 26 Apr 2021 12:31:25 +0800 Subject: [PATCH] judge: fix #116 (problem_rejudge) --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/hosts/hydro.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index e038d31b5..6edfabcba 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.5.14", + "version": "2.5.15", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/hosts/hydro.ts b/packages/hydrojudge/src/hosts/hydro.ts index adc522ed8..4b77dfcf4 100644 --- a/packages/hydrojudge/src/hosts/hydro.ts +++ b/packages/hydrojudge/src/hosts/hydro.ts @@ -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());