Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sb_h5
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
sb_h5
Commits
b6b4af72
Commit
b6b4af72
authored
Apr 29, 2019
by
高诸锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix]
parent
8f3344e8
Pipeline
#6704
passed with stage
in 4 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
5 deletions
+39
-5
task.js
app/controller/task.js
+4
-2
get_cityName.js
app/schedule/get_cityName.js
+23
-0
config.local.js
config/config.local.js
+5
-2
config.prod.js
config/config.prod.js
+7
-1
No files found.
app/controller/task.js
View file @
b6b4af72
...
...
@@ -139,9 +139,11 @@ class TaskController extends Controller {
if
(
!
order
)
{
throw
new
Error
(
`【taskId】:
${
taskId
}
任务已经结束.`
);
}
const
{
orderId
,
appKey
,
notifyUrl
,
userId
}
=
order
;
const
{
orderId
,
appKey
,
notifyUrl
,
userId
,
cityId
}
=
order
;
insertData
.
orderId
=
orderId
;
insertData
.
cityName
=
result
.
data
.
jsName
.
split
(
'.'
)[
0
];
// insertData.cityName = result.data.jsName.split('.')[0];
insertData
.
jsName
=
result
.
data
.
jsName
;
insertData
.
cityName
=
ctx
.
app
.
cityNameMap
.
get
(
cityId
);
// TODO insertData.cityId -> cityName
insertData
.
taskId
=
taskId
;
insertData
.
appKey
=
appKey
;
...
...
app/schedule/get_cityName.js
0 → 100644
View file @
b6b4af72
'use strict'
;
module
.
exports
=
{
schedule
:
{
interval
:
'5m'
,
// 5分钟间隔
type
:
'all'
,
// 所有woker
immediate
:
true
,
},
async
task
(
ctx
)
{
try
{
const
result
=
await
ctx
.
javaSb
.
query
(
'SELECT id, name FROM shebao_city'
,
{
type
:
'SELECT'
});
const
cityNameMap
=
new
Map
();
for
(
const
item
of
result
)
{
cityNameMap
.
set
(
String
(
item
.
id
),
item
.
name
);
}
ctx
.
app
.
cityNameMap
=
cityNameMap
;
console
.
log
(
ctx
.
app
.
cityNameMap
);
}
catch
(
e
)
{
ctx
.
logger
.
error
(
e
);
}
},
};
config/config.local.js
View file @
b6b4af72
...
...
@@ -11,6 +11,7 @@ module.exports = () => {
fetchCodeUrl
:
'/shebao/getSbCode'
,
submitTaskUrl
:
'/shebao/loginSbWeb'
,
fetchTaskUrl
:
'/shebao/getSbData'
,
// 获取该task状态
redisTaskPrefix
:
'DATA_SERVER_SHEBAO.TASK'
,
};
config
.
partnerAPI
=
{
...
...
@@ -34,6 +35,8 @@ module.exports = () => {
fetchHelpUrl
:
'/chaos/ss/help'
,
fetchNoticeUrl
:
'/chaos/ss/notice'
,
fetchHubSeriptsUrl
:
'/chaos/ss/hubs'
,
centersInfoUrl
:
'https://t.51gjj.com/shebao/centersInfo'
,
cityInfoUrl
:
'https://t.51gjj.com/shebao/cityConfig'
,
fetchScriptByCityNameUrl
:
'/chaos/ss/city_scripts'
,
redisScriptsKey
:
'DATA_SERVER_SHEBAO.SCRIPTS'
,
redisParamsKey
:
'DATA_SERVER_SHEBAO.PARAMS'
,
...
...
@@ -95,11 +98,11 @@ module.exports = () => {
},
{
// 东八时区
timezone
:
'+08:00'
,
delegate
:
'
cusPro
'
,
delegate
:
'
javaSb
'
,
baseDir
:
'model'
,
dialect
:
'mysql'
,
host
:
'rm-bp1272001633qc0x9o.mysql.rds.aliyuncs.com'
,
database
:
'java_
open_platform
'
,
database
:
'java_
sb
'
,
username
:
'hexin'
,
password
:
'gYUHszn9#q'
,
port
:
3306
,
...
...
config/config.prod.js
View file @
b6b4af72
...
...
@@ -20,6 +20,10 @@ module.exports = () => {
fetchScripts
:
'/chaos/partners/scripts'
,
redisThemePrefix
:
'DATA_SERVER_SHEBAO.PARNTERS.THEME'
,
redisScriptsPrefix
:
'DATA_SERVER_SHEBAO.PARNTERS.SCRIPTS'
,
fetchAgreements
:
'/chaos/agreements'
,
redisAgreementsPrefix
:
'DATA_SERVER_SHEBAO.AGREEMENTS'
,
fetchInfo
:
'/chaos/partner'
,
redisInfoPrefix
:
'DATA_SERVER_SHEBAO.PARTNERINFO'
,
};
config
.
scriptsAPI
=
{
...
...
@@ -36,6 +40,7 @@ module.exports = () => {
fetchScriptByCityNameUrl
:
'/chaos/ss/city_scripts'
,
redisScriptsKey
:
'DATA_SERVER_SHEBAO.SCRIPTS'
,
redisParamsKey
:
'DATA_SERVER_SHEBAO.PARAMS'
,
redisScriptListKey
:
'DATA_SERVER_SHEBAO.SCRIPTLIST'
,
};
config
.
storageAPI
=
{
...
...
@@ -66,6 +71,7 @@ module.exports = () => {
fecteToken
:
'NEWSB.SS.TOKEN.LOCK'
,
token
:
'NEWSB.SS.TOKEN'
,
fecthParnters
:
'NEWSB.PARNTERS.LOCK'
,
taskPrefix
:
'NEWSB.TASK'
,
};
config
.
sequelize
=
{
...
...
@@ -83,7 +89,7 @@ module.exports = () => {
},
{
// 东八时区
timezone
:
'+08:00'
,
delegate
:
'
cusPro
'
,
delegate
:
'
javaSb
'
,
baseDir
:
'model'
,
dialect
:
'mysql'
,
host
:
process
.
env
.
MYSQL_PACHONG_HOST
,
...
...
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