core: fix addProgress

pull/311/head
undefined 3 years ago
parent 8810ccd285
commit f8f4d82c0a

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.4.15",
"version": "3.4.16",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",

@ -71,7 +71,7 @@ export async function next(body: JudgeResultBody) {
if (body.time !== undefined) $set.time = body.time;
if (body.memory !== undefined) $set.memory = body.memory;
if (body.progress !== undefined) $set.progress = body.progress;
rdoc = await record.update(rdoc.domainId, body.rid, $set, $push, {}, body.addProgress ? { progress: body.progress } : {});
rdoc = await record.update(rdoc.domainId, body.rid, $set, $push, {}, body.addProgress ? { progress: body.addProgress } : {});
bus.broadcast('record/change', rdoc!, $set, $push);
}

@ -822,7 +822,8 @@ export class ConnectionHandler extends HandlerCommon {
onerror(err: HydroError) {
if (err instanceof UserFacingError) err.stack = this.conn.pathname;
if (!(err instanceof NotFoundError)) {
if (!(err instanceof NotFoundError)
&& !((err instanceof PrivilegeError || err instanceof PermissionError) && this.user._id === 0)) {
logger.error(`Path:${this.conn.pathname}, User:${this.user._id}(${this.user.uname})`);
logger.error(err);
}
@ -903,7 +904,6 @@ export function Connection(
connCount.dec();
});
} catch (e) {
logger.warn('%o', e);
await h.onerror(e);
}
});

Loading…
Cancel
Save