Commit 1b4332f6 authored by 姜登's avatar 姜登

限制增加数量

parent 7efa501a
Pipeline #18424 passed with stage
in 5 seconds
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: jd * @Author: jd
* @Date: 2019-02-25 18:59:53 * @Date: 2019-02-25 18:59:53
* @LastEditors : jd * @LastEditors : jd
* @LastEditTime : 2019-12-21 15:20:30 * @LastEditTime : 2019-12-21 17:12:50
*/ */
'use strict'; 'use strict';
...@@ -49,7 +49,7 @@ class CacheService extends Service { ...@@ -49,7 +49,7 @@ class CacheService extends Service {
const { count } = JSON.parse(iplimit); const { count } = JSON.parse(iplimit);
await app.redis.set(ip[0], JSON.stringify({ count: count + 1 }), 'EX', 15 * 3600); await app.redis.set(ip[0], JSON.stringify({ count: count + 1 }), 'EX', 15 * 3600);
ctx.logger.info(`ipLimit ADD ${ip[0]} value:`, count + 1); ctx.logger.info(`ipLimit ADD ${ip[0]} value:`, count + 1);
if (count + 1 > 30) { if (count + 1 > 21) {
ctx.logger.info(`ipLimit ${ip[0]} MAX30LIMIT 提交任务失败`); ctx.logger.info(`ipLimit ${ip[0]} MAX30LIMIT 提交任务失败`);
ctx.throw(400, { message: '提交任务失败' }); ctx.throw(400, { message: '提交任务失败' });
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment