Authored by 李奇

upgrade yoho-node-lib 0.6.7

@@ -149,24 +149,27 @@ module.exports = { @@ -149,24 +149,27 @@ module.exports = {
149 redis: { 149 redis: {
150 connect: { 150 connect: {
151 host: '127.0.0.1', 151 host: '127.0.0.1',
  152 +
152 // host: '192.168.102.49', 153 // host: '192.168.102.49',
153 port: '6379', 154 port: '6379',
  155 + enable_offline_queue: false,
154 retry_strategy(options) { 156 retry_strategy(options) {
155 if (options.error && options.error.code === 'ECONNREFUSED') { 157 if (options.error && options.error.code === 'ECONNREFUSED') {
156 - console.log('redis连接不成功');  
157 - }  
158 - if (options.total_retry_time > 1000 * 60 * 60 * 6) {  
159 - console.log('redis连接超时');  
160 - return;  
161 - }  
162 - if (options.attempt > 10) {  
163 - return 1000 * 60 * 60 * 0.5; 158 + console.log('connect redis server fail');
164 } 159 }
  160 +
  161 + if (options.attempt < 10) {
165 return Math.min(options.attempt * 100, 1000); 162 return Math.min(options.attempt * 100, 1000);
  163 + } else if (options.attempt > 10 && options.attempt < 100) {
  164 + return 1000;
  165 + } else {
  166 + return 1000 * 10;
  167 + }
166 } 168 }
167 }, 169 },
168 session: { 170 session: {
169 host: '127.0.0.1', 171 host: '127.0.0.1',
  172 +
170 // host: '192.168.102.49', 173 // host: '192.168.102.49',
171 port: '6379', 174 port: '6379',
172 prefix: 'yohobuy_session:' 175 prefix: 'yohobuy_session:'
@@ -214,18 +217,19 @@ if (isProduction) { @@ -214,18 +217,19 @@ if (isProduction) {
214 connect: { 217 connect: {
215 host: 'web.redis.yohoops.org', 218 host: 'web.redis.yohoops.org',
216 port: '6379', 219 port: '6379',
  220 + enable_offline_queue: false,
217 retry_strategy(options) { 221 retry_strategy(options) {
218 if (options.error && options.error.code === 'ECONNREFUSED') { 222 if (options.error && options.error.code === 'ECONNREFUSED') {
219 - console.log('redis连接不成功');  
220 - }  
221 - if (options.total_retry_time > 1000 * 60 * 60 * 6) {  
222 - console.log('redis连接超时');  
223 - return;  
224 - }  
225 - if (options.attempt > 10) {  
226 - return 1000 * 60 * 60 * 0.5; 223 + console.log('connect redis server fail');
227 } 224 }
  225 +
  226 + if (options.attempt < 10) {
228 return Math.min(options.attempt * 100, 1000); 227 return Math.min(options.attempt * 100, 1000);
  228 + } else if (options.attempt > 10 && options.attempt < 100) {
  229 + return 1000;
  230 + } else {
  231 + return 1000 * 10;
  232 + }
229 } 233 }
230 }, 234 },
231 session: { 235 session: {
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 "urlencode": "^1.1.0", 57 "urlencode": "^1.1.0",
58 "uuid": "^2.0.2", 58 "uuid": "^2.0.2",
59 "yoho-express-session": "^2.0.0", 59 "yoho-express-session": "^2.0.0",
60 - "yoho-node-lib": "=0.6.6", 60 + "yoho-node-lib": "=0.6.7",
61 "yoho-zookeeper": "^1.0.8" 61 "yoho-zookeeper": "^1.0.8"
62 }, 62 },
63 "devDependencies": { 63 "devDependencies": {
@@ -8670,9 +8670,9 @@ yoho-jquery@^1.12.4: @@ -8670,9 +8670,9 @@ yoho-jquery@^1.12.4:
8670 version "1.12.4" 8670 version "1.12.4"
8671 resolved "http://npm.yohops.com/yoho-jquery/-/yoho-jquery-1.12.4.tgz#22499b325f293ee8b1d60559777348156494926d" 8671 resolved "http://npm.yohops.com/yoho-jquery/-/yoho-jquery-1.12.4.tgz#22499b325f293ee8b1d60559777348156494926d"
8672 8672
8673 -yoho-node-lib@=0.6.6:  
8674 - version "0.6.6"  
8675 - resolved "http://npm.yohops.com/yoho-node-lib/-/yoho-node-lib-0.6.6.tgz#2c727bed970d8829730ac077bd379aa506db16f3" 8673 +yoho-node-lib@=0.6.7:
  8674 + version "0.6.7"
  8675 + resolved "http://npm.yohops.com/yoho-node-lib/-/yoho-node-lib-0.6.7.tgz#1d176e7c4a980288ed7d0a7f1d9b3b37284837fb"
8676 dependencies: 8676 dependencies:
8677 dnscache "^1.0.1" 8677 dnscache "^1.0.1"
8678 handlebars "^4.0.5" 8678 handlebars "^4.0.5"