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

+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 });
}
}
}