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());