|
@@ -32,6 +32,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
@@ -32,6 +32,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
32
|
const fWrite = fs.createWriteStream(`${ROOT_PATH}/public/dist/${fileName}`);
|
32
|
const fWrite = fs.createWriteStream(`${ROOT_PATH}/public/dist/${fileName}`);
|
33
|
|
33
|
|
34
|
fWrite.write(goodsHbs({products: result}).replace(/\s+/g, ' '));// max 9.5M
|
34
|
fWrite.write(goodsHbs({products: result}).replace(/\s+/g, ' '));// max 9.5M
|
|
|
35
|
+ fWrite.end();
|
35
|
|
36
|
|
36
|
result = [];
|
37
|
result = [];
|
37
|
|
38
|
|
|
@@ -161,6 +162,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
@@ -161,6 +162,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
161
|
console.log(`autoGoodsXml: params: ${JSON.stringify(params)}`);
|
162
|
console.log(`autoGoodsXml: params: ${JSON.stringify(params)}`);
|
162
|
|
163
|
|
163
|
if (rdata.code !== 200) {
|
164
|
if (rdata.code !== 200) {
|
|
|
165
|
+ global.IS_GOODS_XML_RUN = false;
|
164
|
return {};
|
166
|
return {};
|
165
|
}
|
167
|
}
|
166
|
|
168
|
|
|
@@ -169,14 +171,14 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
@@ -169,14 +171,14 @@ class SeoIndexModel extends global.yoho.BaseModel { |
169
|
}
|
171
|
}
|
170
|
|
172
|
|
171
|
setTask(params) {
|
173
|
setTask(params) {
|
172
|
- return redis.hset('global:yoho:seo:task', md5(params.url), JSON.stringify({
|
174
|
+ return redis.hsetAsync('global:yoho:seo:task', md5(params.url), JSON.stringify({
|
173
|
url: params.url,
|
175
|
url: params.url,
|
174
|
time: params.time || 1000
|
176
|
time: params.time || 1000
|
175
|
}));
|
177
|
}));
|
176
|
}
|
178
|
}
|
177
|
|
179
|
|
178
|
delTask(url) {
|
180
|
delTask(url) {
|
179
|
- return redis.hdel('global:yoho:seo:task', md5(url));
|
181
|
+ return redis.hdelAsync('global:yoho:seo:task', md5(url));
|
180
|
}
|
182
|
}
|
181
|
}
|
183
|
}
|
182
|
|
184
|
|