Skip to content

Commit

Permalink
fix(ccfinder): init data start after clear
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyoukun committed Jun 13, 2018
1 parent bfb00c2 commit 398bf63
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bin/tsw/runtime/CCFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ this.check = function (req, res) {
return true;
}

if (!cache.ipCache.start) {
cache.ipCache.start = Date.now();
}

ipConut = ipConut - 1;

if (ipConut <= 0) {
Expand All @@ -162,6 +158,10 @@ this.check = function (req, res) {
tnm2.Attr_API_Set('AVG_TSW_IP_STD_X10', cache.ipCacheLast.StdX10);
}

if (!cache.ipCache.start) {
cache.ipCache.start = Date.now();
}

if (Date.now() - cache.ipCache.start > 60000) {
// 时间太长
ipConut = 0;
Expand All @@ -170,7 +170,6 @@ this.check = function (req, res) {

if (!cache.ipCache[userIp]) {
cache.ipCache[userIp] = {
ip007Info: null,
isSendMail: false,
list: []
};
Expand Down

0 comments on commit 398bf63

Please sign in to comment.