mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
vjudge: allow proxy
This commit is contained in:
1 parent
3f1037bb65
commit
62cc229724
4 files changed
+32
-10
No files matched your search
@@ -61,10 +61,20 @@ class Service {
|
||||
}
|
||||
}
|
||||
|
||||
async main() {
|
||||
async login() {
|
||||
const login = await this.api.ensureLogin();
|
||||
if (login) logger.info(`${this.account.type}/${this.account.handle}: logged in`);
|
||||
else return;
|
||||
if (login) {
|
||||
logger.info(`${this.account.type}/${this.account.handle}: logged in`);
|
||||
return true;
|
||||
}
|
||||
logger.warn(`${this.account.type}/${this.account.handle}: login fail`);
|
||||
return false;
|
||||
}
|
||||
|
||||
async main() {
|
||||
const res = await this.login();
|
||||
if (!res) return;
|
||||
setInterval(() => this.login(), 1 * 3600 * 1000);
|
||||
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) {
|
||||
|
||||
Reference in new issue
Block a user