ui: 修复比赛中评测记录列表不会自动刷新的问题

This commit is contained in:
undefined committed 2021-08-02 10:46:35 +08:00
1 parent 998248e212
commit bc90574735
5 files changed
+11 -8

No files matched your search

+2 -2
View File
@@ -232,9 +232,9 @@ class RecordMainConnectionHandler extends ConnectionHandler {
// eslint-disable-next-line prefer-const
let [udoc, pdoc] = await Promise.all([
user.getById(this.domainId, rdoc.uid),
problem.get(this.domainId, rdoc.pid),
problem.get(rdoc.pdomain, rdoc.pid),
]);
const tdoc = this.tid ? contest.get(this.domainId, new ObjectID(this.tid)) : null;
const tdoc = this.tid ? await contest.get(this.domainId, new ObjectID(this.tid)) : null;
if (pdoc && !rdoc.contest) {
if (pdoc.hidden && !this.user.own(pdoc) && !this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) pdoc = null;
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null;
+2 -2
View File
@@ -103,9 +103,9 @@ export interface EventMap extends Record<string, any> {
function getHooks<K extends keyof EventMap>(name: K) {
const hooks = _hooks[name] || (_hooks[name] = []);
if (hooks.length >= 128) {
if (hooks.length >= 2048) {
logger.warn(
'max listener count (128) for event "%s" exceeded, which may be caused by a memory leak',
'max listener count (2048) for event "%s" exceeded, which may be caused by a memory leak',
name,
);
}