core: limits: allow by-user

This commit is contained in:
undefined committed 2022-11-19 10:27:57 +08:00
1 parent f65aba6d27
commit 273a0563b3
5 files changed
+10 -9

No files matched your search

+2 -2
View File
@@ -287,7 +287,7 @@ export class ContestScoreboardHandler extends ContestDetailBaseHandler {
}
async exportScoreboard(domainId: string, tid: ObjectID, ext: string) {
await this.limitRate('scoreboard_download', 120, 3);
await this.limitRate('scoreboard_download', 60, 3);
if (ext === 'ghost') {
await this.exportGhost(domainId, tid);
return;
@@ -415,7 +415,7 @@ export class ContestCodeHandler extends Handler {
@param('tid', Types.ObjectID)
@param('all', Types.Boolean)
async get(domainId: string, tid: ObjectID, all: boolean) {
await this.limitRate('contest_code', 3600, 60);
await this.limitRate('contest_code', 60, 10);
const [tdoc, tsdocs] = await contest.getAndListStatus(domainId, tid);
if (!this.user.own(tdoc) && !this.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE)) {
this.checkPerm(PERM.PERM_READ_RECORD_CODE);