Merge branch 'hotfix/incr-error' into 'master'
fix memcached incr See merge request !86
Showing
3 changed files
with
4 additions
and
7 deletions
@@ -64,7 +64,7 @@ const homeNav = (req) => { | @@ -64,7 +64,7 @@ const homeNav = (req) => { | ||
64 | {name: '我的信息', href: '/home/message', count: 0}, | 64 | {name: '我的信息', href: '/home/message', count: 0}, |
65 | { | 65 | { |
66 | name: '在线客服', | 66 | name: '在线客服', |
67 | - href: _.get(req.app.locals.pc, 'clientService.new', false) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client', | 67 | + href: _.get(req.app.locals.pc, 'clientService.new', false) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client', |
68 | isBlank: true | 68 | isBlank: true |
69 | } | 69 | } |
70 | ] | 70 | ] |
@@ -29,8 +29,6 @@ module.exports = (limiter, policy) => { | @@ -29,8 +29,6 @@ module.exports = (limiter, policy) => { | ||
29 | 29 | ||
30 | const key = `pc:limiter:${limiter.remoteIp}`; | 30 | const key = `pc:limiter:${limiter.remoteIp}`; |
31 | 31 | ||
32 | - let isNew = true; | ||
33 | - | ||
34 | res.on('render', function() { | 32 | res.on('render', function() { |
35 | let route = req.route ? req.route.path : ''; | 33 | let route = req.route ? req.route.path : ''; |
36 | let appPath = req.app.mountpath; | 34 | let appPath = req.app.mountpath; |
@@ -46,15 +44,14 @@ module.exports = (limiter, policy) => { | @@ -46,15 +44,14 @@ module.exports = (limiter, policy) => { | ||
46 | pageIncr = 5; | 44 | pageIncr = 5; |
47 | } | 45 | } |
48 | 46 | ||
49 | - if (pageIncr > 0 && !isNew) { | ||
50 | - cache.incrAsync(key, pageIncr); | 47 | + if (pageIncr > 0) { |
48 | + cache.incr(key, pageIncr, (err) => {}); | ||
51 | } | 49 | } |
52 | }); | 50 | }); |
53 | 51 | ||
54 | return cache.getAsync(key).then((result) => { | 52 | return cache.getAsync(key).then((result) => { |
55 | logger.debug('qps limiter: ' + key + '@' + result + ' max: ' + MAX_QPS); | 53 | logger.debug('qps limiter: ' + key + '@' + result + ' max: ' + MAX_QPS); |
56 | if (result && _.isNumber(result)) { | 54 | if (result && _.isNumber(result)) { |
57 | - isNew = false; | ||
58 | if (result === -1) { | 55 | if (result === -1) { |
59 | return Promise.resolve(true); | 56 | return Promise.resolve(true); |
60 | } | 57 | } |
@@ -189,7 +189,7 @@ | @@ -189,7 +189,7 @@ | ||
189 | </div> | 189 | </div> |
190 | <div class="left"> | 190 | <div class="left"> |
191 | <span class="iconfont rgbf"></span> | 191 | <span class="iconfont rgbf"></span> |
192 | - <a href="{{#if @root.pc.clientService.new}}http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409{{else}}/service/client{{/if}}" target="_blank"> | 192 | + <a href="{{#if @root.pc.clientService.new}}http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409{{else}}/service/client{{/if}}" target="_blank"> |
193 | <span class="red">便捷</span> | 193 | <span class="red">便捷</span> |
194 | <span class="rgbf">在线客服</span> | 194 | <span class="rgbf">在线客服</span> |
195 | </a> | 195 | </a> |
-
Please register or login to post a comment