mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: fix addProgress
This commit is contained in:
1 parent
8810ccd285
commit
f8f4d82c0a
3 files changed
+4
-4
No files matched your search
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user