mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: send: detailed logs
This commit is contained in:
1 parent
0fcbcf4f1a
commit
437bfc5e6e
4 files changed
+7
-7
No files matched your search
@@ -63,11 +63,11 @@ class ProxySendRequestHandler extends Handler {
|
|||||||
let res = await superagent.post(`${url}d/${domainId}/problem/send`)
|
let res = await superagent.post(`${url}d/${domainId}/problem/send`)
|
||||||
.send({ operation: 'info', token: tokenId })
|
.send({ operation: 'info', token: tokenId })
|
||||||
.catch((e) => e);
|
.catch((e) => e);
|
||||||
if (res instanceof Error) throw new RemoteOnlineJudgeError(res.message);
|
if (res instanceof Error) throw new RemoteOnlineJudgeError(`[Post Target/Send/Info] ${res.message}`);
|
||||||
res = await superagent.post(`${endpoint}/problem/receive`).send({
|
res = await superagent.post(`${endpoint}/problem/receive`).send({
|
||||||
operation: 'request', url: `${url}d/${domainId}/problem/send`, tokenId, expire,
|
operation: 'request', url: `${url}d/${domainId}/problem/send`, tokenId, expire,
|
||||||
}).catch((e) => e);
|
}).catch((e) => e);
|
||||||
if (res instanceof Error) throw new RemoteOnlineJudgeError(res.message);
|
if (res instanceof Error) throw new RemoteOnlineJudgeError(`[Post Target/Receive/Request] ${res.message}`);
|
||||||
this.response.body = { code: 0 };
|
this.response.body = { code: 0 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/center",
|
"name": "@hydrooj/center",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.26.24",
|
"version": "2.26.25",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export class ProblemSendHandler extends Handler {
|
|||||||
.send({
|
.send({
|
||||||
operation: 'request', url: `${url}d/${domainId}/problem/send`, tokenId, expire,
|
operation: 'request', url: `${url}d/${domainId}/problem/send`, tokenId, expire,
|
||||||
}).catch(logAndReturn(logger));
|
}).catch(logAndReturn(logger));
|
||||||
if (res instanceof Error) throw new RemoteOnlineJudgeError(res.message);
|
if (res instanceof Error) throw new RemoteOnlineJudgeError(`[Post Target/Request] ${res.message}`);
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ export class ProblemReceiveHandler extends Handler {
|
|||||||
const res = await superagent.post(url)
|
const res = await superagent.post(url)
|
||||||
.send({ operation: 'info', token: tokenId })
|
.send({ operation: 'info', token: tokenId })
|
||||||
.catch(logAndReturn(logger));
|
.catch(logAndReturn(logger));
|
||||||
if (res instanceof Error) throw new RemoteOnlineJudgeError(res.message);
|
if (res instanceof Error) throw new RemoteOnlineJudgeError(`[Post Origin/Info] ${res.message}`);
|
||||||
const [id] = await token.add(token.TYPE_IMPORT, expire, {
|
const [id] = await token.add(token.TYPE_IMPORT, expire, {
|
||||||
domainId, tokenId, source: url, pdocs: res.body.pdocs, pids: res.body.pids,
|
domainId, tokenId, source: url, pdocs: res.body.pdocs, pids: res.body.pids,
|
||||||
});
|
});
|
||||||
@@ -154,7 +154,7 @@ export class ProblemReceiveHandler extends Handler {
|
|||||||
token: data.tokenId,
|
token: data.tokenId,
|
||||||
pids: filterPid.length ? filterPid.map((i) => (+i ? +i : i)) : data.pids,
|
pids: filterPid.length ? filterPid.map((i) => (+i ? +i : i)) : data.pids,
|
||||||
}).catch(logAndReturn(logger));
|
}).catch(logAndReturn(logger));
|
||||||
if (res instanceof Error) throw new RemoteOnlineJudgeError(res.message);
|
if (res instanceof Error) throw new RemoteOnlineJudgeError(`[Post Origin/Fetch] ${res.message}`);
|
||||||
const pids = [];
|
const pids = [];
|
||||||
const { pdocs } = res.body;
|
const { pdocs } = res.body;
|
||||||
const files = res.body.links;
|
const files = res.body.links;
|
||||||
|
|||||||
Reference in new issue
Block a user