Showing
5 changed files
with
7 additions
and
5 deletions
@@ -21,7 +21,7 @@ class MySqlSender { | @@ -21,7 +21,7 @@ class MySqlSender { | ||
21 | const len = this.batchMessages.length; | 21 | const len = this.batchMessages.length; |
22 | 22 | ||
23 | if (len < 1) { | 23 | if (len < 1) { |
24 | - logger.debug('[db] insert list is empty'); | 24 | + // logger.debug('[db] insert list is empty'); |
25 | return; | 25 | return; |
26 | } | 26 | } |
27 | 27 |
@@ -58,7 +58,7 @@ module.exports = (req, res, next) => { | @@ -58,7 +58,7 @@ module.exports = (req, res, next) => { | ||
58 | item.u = 0; | 58 | item.u = 0; |
59 | } | 59 | } |
60 | } catch (e) { | 60 | } catch (e) { |
61 | - logger.debug('[client] decode uid error [%s]', item.u); | 61 | + logger.error('[client] decode uid error [%s]', item.u); |
62 | item.u = 0; | 62 | item.u = 0; |
63 | } | 63 | } |
64 | } else { | 64 | } else { |
@@ -15,8 +15,8 @@ module.exports = async({user}, next) => { | @@ -15,8 +15,8 @@ module.exports = async({user}, next) => { | ||
15 | let ipBlackRes = result[0]; | 15 | let ipBlackRes = result[0]; |
16 | let ipLimitRes = result[1]; | 16 | let ipLimitRes = result[1]; |
17 | 17 | ||
18 | - logger.debug('ip==>', ipBlackKey, ipBlackRes); | ||
19 | - logger.debug('ip==>', ipLimitKey, ipLimitRes); | 18 | + logger.debug('ip==>%s value=%d', ipBlackKey, ipBlackRes || 0); |
19 | + logger.debug('ip==>%s value=%d', ipLimitKey, ipLimitRes || 0); | ||
20 | 20 | ||
21 | if ((ipBlackRes && +ipBlackRes > 0) || (ipLimitRes && +ipLimitRes > 0)) { | 21 | if ((ipBlackRes && +ipBlackRes > 0) || (ipLimitRes && +ipLimitRes > 0)) { |
22 | return; | 22 | return; |
@@ -28,6 +28,8 @@ module.exports = async({user}, next) => { | @@ -28,6 +28,8 @@ module.exports = async({user}, next) => { | ||
28 | getOp.human = cache.getAsync(`${appType}:${limitKey}:ishuman:${user.ip}`); | 28 | getOp.human = cache.getAsync(`${appType}:${limitKey}:ishuman:${user.ip}`); |
29 | 29 | ||
30 | return Promise.props(getOp).then((results) => { | 30 | return Promise.props(getOp).then((results) => { |
31 | + logger.debug('[qps result] %j', getOp); | ||
32 | + | ||
31 | if (results.human) { // 经过验证码之后1小时有效期内不再验证qps | 33 | if (results.human) { // 经过验证码之后1小时有效期内不再验证qps |
32 | logger.info('[qps] this user[%j] is being marked as human', user); | 34 | logger.info('[qps] this user[%j] is being marked as human', user); |
33 | return {}; | 35 | return {}; |
@@ -28,7 +28,7 @@ module.exports = async({user}, next) => { | @@ -28,7 +28,7 @@ module.exports = async({user}, next) => { | ||
28 | let key = `${WHITE_LIST_KEY}${remoteIp}`; | 28 | let key = `${WHITE_LIST_KEY}${remoteIp}`; |
29 | let remoteIpSegment = `${remoteIp.split('.').slice(0, 2).join('.')}.`; | 29 | let remoteIpSegment = `${remoteIp.split('.').slice(0, 2).join('.')}.`; |
30 | 30 | ||
31 | - logger.debug('whitelist-ip==>%s', user.path); | 31 | + logger.debug('whitelist-ip==>%s', user.ip); |
32 | if (_.includes(IP_WHITE_LIST, remoteIp) || _.includes(IP_WHITE_SEGMENT, remoteIpSegment)) { | 32 | if (_.includes(IP_WHITE_LIST, remoteIp) || _.includes(IP_WHITE_SEGMENT, remoteIpSegment)) { |
33 | return; | 33 | return; |
34 | } | 34 | } |
-
Please register or login to post a comment