Commit 4cfda883 authored by 何娜's avatar 何娜

citylist

parent e32506a3
Pipeline #4416 passed with stage
in 5 seconds
......@@ -2,7 +2,7 @@
module.exports = {
schedule: {
interval: '5m', // 5分钟间隔
interval: '1m', // 5分钟间隔
type: 'all', // 所有woker
immediate: true,
},
......@@ -41,9 +41,12 @@ module.exports = {
if (ret.data.code === 0) {
cityLists = [];
cityTypeLists = [];
ctx.logger.info('start')
ret.data.data.map(Prov => {
ctx.logger.info('newProv')
let newProv = {provinceName: Prov.provinceName, citys: []};
Prov.citys.map(city => {
ctx.logger.info('51gs')
city.type = "51gs";
if (city.state === -1 && newCityMap.get(String(city.id)) && newCityMap.get(String(city.id)).state !== -1) {
city = newCityMap.get(String(city.id));
......@@ -53,6 +56,7 @@ module.exports = {
cityMap.set(String(city.id), city);
if (city.state != 1) {
city.state = -1;
ctx.logger.info('state')
}
newProv.citys.push({
province: city.province,
......@@ -61,19 +65,24 @@ module.exports = {
state: city.state,
queryParam: city.queryParam
});
ctx.logger.info('newProv-push')
cityTypeLists.push({
province: city.province,
name: city.name,
id: city.id,
state: city.state,
type: city.type,
})
});
ctx.logger.info('cityTypeLists-push')
});
ctx.logger.info('newProv-end')
cityLists.push(newProv);
});
ctx.logger.info('cityLists', cityLists.length, 'cityTypeLists', cityTypeLists[0])
ctx.app.cityLists = cityLists;
ctx.app.cityTypeLists = cityTypeLists;
}else{
ctx.logger.info('拉配置出错')
}
} catch (e) {
ctx.logger.error('【schedule/cityList】catch error:', JSON.stringify(e));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment