vjudge: handle superagent proxy change

This commit is contained in:
undefined committed 2021-09-23 16:48:56 +08:00
1 parent b8deb8a572
commit dca8e28361
5 files changed
+13 -7

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
/* eslint-disable no-await-in-loop */
import { PassThrough } from 'stream';
import { JSDOM } from 'jsdom';
import * as superagent from 'superagent';
import superagent from 'superagent';
import proxy from 'superagent-proxy';
import { STATUS } from '@hydrooj/utils/lib/status';
import { sleep } from '@hydrooj/utils/lib/utils';
@@ -10,7 +10,7 @@ import { Logger } from 'hydrooj/src/logger';
import * as setting from 'hydrooj/src/model/setting';
import { IBasicProvider, RemoteAccount } from '../interface';
proxy(superagent as any);
proxy(superagent);
const logger = new Logger('codeforces');
const VERDICT = {
+2 -2
View File
@@ -1,7 +1,7 @@
/* eslint-disable no-await-in-loop */
import { JSDOM } from 'jsdom';
import { flattenDeep } from 'lodash';
import * as superagent from 'superagent';
import superagent from 'superagent';
import proxy from 'superagent-proxy';
import { STATUS } from '@hydrooj/utils/lib/status';
import { sleep } from '@hydrooj/utils/lib/utils';
@@ -9,7 +9,7 @@ import { Logger } from 'hydrooj/src/logger';
import * as setting from 'hydrooj/src/model/setting';
import { IBasicProvider, RemoteAccount } from '../interface';
proxy(superagent as any);
proxy(superagent);
const logger = new Logger('remote/luogu');
const STATUS_MAP = [
+2 -2
View File
@@ -1,7 +1,7 @@
/* eslint-disable no-await-in-loop */
import { PassThrough } from 'stream';
import { JSDOM } from 'jsdom';
import * as superagent from 'superagent';
import superagent from 'superagent';
import proxy from 'superagent-proxy';
import { STATUS } from '@hydrooj/utils/lib/status';
import { parseMemoryMB, sleep } from '@hydrooj/utils/lib/utils';
@@ -9,7 +9,7 @@ import { Logger } from 'hydrooj/src/logger';
import * as setting from 'hydrooj/src/model/setting';
import { IBasicProvider, RemoteAccount } from '../interface';
proxy(superagent as any);
proxy(superagent);
const logger = new Logger('spoj');
const VERDICT = {
+6
View File
@@ -0,0 +1,6 @@
declare module 'superagent' {
interface Request {
proxy(url: string): this;
}
}
export default {};