Authored by 李奇

Merge branch 'feature/remove-memcached' into feature/docker

@@ -145,7 +145,6 @@ module.exports = { @@ -145,7 +145,6 @@ module.exports = {
145 apiCache: { 145 apiCache: {
146 cache: true 146 cache: true
147 }, 147 },
148 - sessionRedisPrefix: 'yohobuy_session:',  
149 zookeeperServer: '192.168.102.168:2188', 148 zookeeperServer: '192.168.102.168:2188',
150 redis: { 149 redis: {
151 connect: { 150 connect: {
@@ -164,6 +163,11 @@ module.exports = { @@ -164,6 +163,11 @@ module.exports = {
164 } 163 }
165 return Math.min(options.attempt * 100, 1000); 164 return Math.min(options.attempt * 100, 1000);
166 } 165 }
  166 + },
  167 + session: {
  168 + host: '192.168.102.49',
  169 + port: '6379',
  170 + prefix: 'yohobuy_session:'
167 } 171 }
168 }, 172 },
169 REQUEST_LIMIT: { 173 REQUEST_LIMIT: {
@@ -206,21 +210,27 @@ if (isProduction) { @@ -206,21 +210,27 @@ if (isProduction) {
206 zookeeperServer: 'web.zookeeper.yohoops.org:2181', 210 zookeeperServer: 'web.zookeeper.yohoops.org:2181',
207 redis: { 211 redis: {
208 connect: { 212 connect: {
209 - host: 'web.redis.yohoops.org'  
210 - },  
211 - port: '6379',  
212 - retry_strategy(options) {  
213 - if (options.error && options.error.code === 'ECONNREFUSED') {  
214 - console.log('redis连接不成功');  
215 - }  
216 - if (options.total_retry_time > 1000 * 60 * 60 * 6) {  
217 - console.log('redis连接超时');  
218 - return;  
219 - }  
220 - if (options.attempt > 10) {  
221 - return 1000 * 60 * 60 * 0.5; 213 + host: 'web.redis.yohoops.org',
  214 + port: '6379',
  215 + retry_strategy(options) {
  216 + if (options.error && options.error.code === 'ECONNREFUSED') {
  217 + console.log('redis连接不成功');
  218 + }
  219 + if (options.total_retry_time > 1000 * 60 * 60 * 6) {
  220 + console.log('redis连接超时');
  221 + return;
  222 + }
  223 + if (options.attempt > 10) {
  224 + return 1000 * 60 * 60 * 0.5;
  225 + }
  226 + return Math.min(options.attempt * 100, 1000);
222 } 227 }
223 - return Math.min(options.attempt * 100, 1000); 228 + },
  229 + session: {
  230 + host: 'redis.web.yohoops.org',
  231 + port: '6379',
  232 + pass: 'redis9646',
  233 + prefix: 'yohobuy_session:'
224 } 234 }
225 }, 235 },
226 report: { 236 report: {
@@ -244,25 +254,6 @@ if (isProduction) { @@ -244,25 +254,6 @@ if (isProduction) {
244 yohoNowApi: process.env.YOHO_NOW_API || 'http://yohonow-test.yohops.com:9999/', 254 yohoNowApi: process.env.YOHO_NOW_API || 'http://yohonow-test.yohops.com:9999/',
245 }, 255 },
246 useOneapm: true, 256 useOneapm: true,
247 - useCache: true,  
248 - redis: {  
249 - connect: {  
250 - host: '192.168.104.32',  
251 - port: '6379',  
252 - retry_strategy(options) {  
253 - if (options.error && options.error.code === 'ECONNREFUSED') {  
254 - // console.log('redis连接不成功');  
255 - }  
256 - if (options.total_retry_time > 1000 * 60 * 60 * 6) {  
257 - // console.log('redis连接超时');  
258 - return;  
259 - }  
260 - if (options.attempt > 10) {  
261 - return 1000 * 60 * 60 * 0.5;  
262 - }  
263 - return Math.min(options.attempt * 100, 1000);  
264 - }  
265 - }  
266 - } 257 + useCache: true
267 }); 258 });
268 } 259 }
@@ -63,11 +63,7 @@ module.exports = (app) => { @@ -63,11 +63,7 @@ module.exports = (app) => {
63 getid() { 63 getid() {
64 return uuid.v4(); 64 return uuid.v4();
65 }, 65 },
66 - store: new RedisStore({  
67 - port: config.redis.port,  
68 - host: config.redis.connect.host,  
69 - prefix: config.sessionRedisPrefix  
70 - }) 66 + store: new RedisStore(config.redis.session)
71 })); 67 }));
72 68
73 app.use(cookieSession({ // eslint-disable-line 69 app.use(cookieSession({ // eslint-disable-line
@@ -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.5", 60 + "yoho-node-lib": "=0.6.6",
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.5:  
8674 - version "0.6.5"  
8675 - resolved "http://npm.yohops.com/yoho-node-lib/-/yoho-node-lib-0.6.5.tgz#ec9a4fefb03a1453316c085507595dbf2d50ebcc" 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"
8676 dependencies: 8676 dependencies:
8677 dnscache "^1.0.1" 8677 dnscache "^1.0.1"
8678 handlebars "^4.0.5" 8678 handlebars "^4.0.5"