...
|
...
|
@@ -32,6 +32,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
const fWrite = fs.createWriteStream(`${ROOT_PATH}/public/dist/${fileName}`);
|
|
|
|
|
|
fWrite.write(goodsHbs({products: result}).replace(/\s+/g, ' '));// max 9.5M
|
|
|
fWrite.end();
|
|
|
|
|
|
result = [];
|
|
|
|
...
|
...
|
@@ -161,6 +162,7 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
console.log(`autoGoodsXml: params: ${JSON.stringify(params)}`);
|
|
|
|
|
|
if (rdata.code !== 200) {
|
|
|
global.IS_GOODS_XML_RUN = false;
|
|
|
return {};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -169,14 +171,14 @@ class SeoIndexModel extends global.yoho.BaseModel { |
|
|
}
|
|
|
|
|
|
setTask(params) {
|
|
|
return redis.hset('global:yoho:seo:task', md5(params.url), JSON.stringify({
|
|
|
return redis.hsetAsync('global:yoho:seo:task', md5(params.url), JSON.stringify({
|
|
|
url: params.url,
|
|
|
time: params.time || 1000
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
delTask(url) {
|
|
|
return redis.hdel('global:yoho:seo:task', md5(url));
|
|
|
return redis.hdelAsync('global:yoho:seo:task', md5(url));
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|