vjudge: check first-daemon

pull/178/head
undefined 3 years ago
parent 59d4bcf620
commit e042cef4fa

@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/vjudge", "name": "@hydrooj/vjudge",
"version": "1.2.1", "version": "1.2.2",
"description": "Submit problems to remote oj", "description": "Submit problems to remote oj",
"main": "package.json", "main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",

@ -90,6 +90,8 @@ class Service {
} }
async function loadAccounts() { async function loadAccounts() {
// Only start a single daemon
if (!global.Hydro.isFirstWorker) return;
const accounts = await coll.find().toArray(); const accounts = await coll.find().toArray();
for (const account of accounts) { for (const account of accounts) {
if (!providers[account.type]) continue; if (!providers[account.type]) continue;

Loading…
Cancel
Save