mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: 更新请求频率限制
This commit is contained in:
1 parent
3040f17702
commit
b71011b3b9
9 files changed
+17
-14
No files matched your search
@@ -231,6 +231,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
@param('lang', Types.String)
|
||||
@param('code', Types.String)
|
||||
async post(domainId: string, lang: string, code: string) {
|
||||
await this.limitRate('add_record', 60, 5);
|
||||
const rid = await record.add(domainId, this.pdoc.docId, this.user._id, lang, code, true);
|
||||
const [rdoc] = await Promise.all([
|
||||
record.get(domainId, rid),
|
||||
@@ -248,7 +249,7 @@ export class ProblemPretestHandler extends ProblemDetailHandler {
|
||||
@param('code', Types.String)
|
||||
@param('input', Types.String, true)
|
||||
async post(domainId: string, lang: string, code: string, input = '') {
|
||||
this.limitRate('add_record', 3600, 100);
|
||||
await this.limitRate('add_record', 60, 5);
|
||||
const rid = await record.add(
|
||||
domainId, this.pdoc.docId, this.user._id,
|
||||
lang, code, true, input,
|
||||
|
||||
Reference in new issue
Block a user