Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
taxh5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data_server
taxh5
Commits
4cfda883
Commit
4cfda883
authored
Mar 13, 2019
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
citylist
parent
e32506a3
Pipeline
#4416
passed with stage
in 5 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
cityList.js
app/schedule/cityList.js
+11
-2
No files found.
app/schedule/cityList.js
View file @
4cfda883
...
...
@@ -2,7 +2,7 @@
module
.
exports
=
{
schedule
:
{
interval
:
'
5
m'
,
// 5分钟间隔
interval
:
'
1
m'
,
// 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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment