vjudge: add syncDone mark

This commit is contained in:
undefined committed 2021-06-23 19:30:29 +08:00
1 parent 8caa621d8b
commit 2de03000ab
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/vjudge",
"version": "1.0.12",
"version": "1.0.13",
"description": "Submit problems to remote oj",
"main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git",
+4 -1
View File
@@ -67,7 +67,10 @@ class Service {
else return;
TaskModel.consume({ type: 'remotejudge', subType: this.account.type }, this.judge.bind(this));
const ddocs = await DomainModel.getMulti({ mount: this.account.type }).toArray();
for (const ddoc of ddocs) await this.sync(ddoc._id);
for (const ddoc of ddocs) {
if (!ddoc.syncDone) await this.sync(ddoc._id);
await DomainModel.edit(ddoc._id, { syncDone: true });
}
}
}