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

+1 -1
View File
@@ -17,7 +17,7 @@
"devDependencies": {
"@types/jsdom": "^16.2.13",
"@types/lodash": "^4.14.173",
"@types/superagent": "4.1.12",
"@types/superagent": "^4.1.13",
"@types/superagent-proxy": "^2.0.1"
}
}
+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 {};