mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
core: 放宽频率限制
This commit is contained in:
1 parent
213aa16c66
commit
4cf051c8d1
5 files changed
+7
-5
No files matched your search
@@ -252,7 +252,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
if (this.domain.langs && !this.domain.langs.includes(lang)) {
|
||||
throw new BadRequestError('Language not allowed');
|
||||
}
|
||||
await this.limitRate('add_record', 60, 5);
|
||||
await this.limitRate('add_record', 60, system.get('limit.submission'));
|
||||
const rid = await record.add(domainId, this.pdoc.docId, this.user._id, lang, code, true, pretest ? input : undefined);
|
||||
const rdoc = await record.get(domainId, rid);
|
||||
if (!pretest) {
|
||||
@@ -273,7 +273,7 @@ export class ProblemPretestHandler extends ProblemDetailHandler {
|
||||
@param('code', Types.Content)
|
||||
@param('input', Types.Content, true)
|
||||
async post(domainId: string, lang: string, code: string, input = '') {
|
||||
await this.limitRate('add_record', 60, 5);
|
||||
await this.limitRate('do_pretest', 60, system.get('limit.pretest'));
|
||||
const rid = await record.add(
|
||||
domainId, this.pdoc.docId, this.user._id,
|
||||
lang, code, true, input,
|
||||
|
||||
Reference in new issue
Block a user