Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
e90cb160
Commit
e90cb160
authored
Jun 24, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
3db099e1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
13 deletions
+20
-13
brg-queue-center/app/base/api/api.base.js
+2
-2
brg-queue-center/app/base/db/consumer.base.js
+8
-4
brg-queue-center/app/base/db/impl/common/connection.js
+1
-1
brg-queue-center/app/base/utils/esUtils.js
+2
-1
brg-queue-center/app/config/settings.js
+7
-5
No files found.
brg-queue-center/app/base/api/api.base.js
View file @
e90cb160
...
@@ -27,7 +27,7 @@ class APIBase {
...
@@ -27,7 +27,7 @@ class APIBase {
pobj
.
actionBody
.
resultInfo
=
result
;
pobj
.
actionBody
.
resultInfo
=
result
;
pobj
.
actionBody
.
requestId
=
result
.
requestId
;
pobj
.
actionBody
.
requestId
=
result
.
requestId
;
pobj
.
actionBody
.
opTitle
=
"reqPath:"
+
req
.
path
;
pobj
.
actionBody
.
opTitle
=
"reqPath:"
+
req
.
path
;
this
.
esUtils
.
addEsLogs
(
settings
.
queuedName
+
"api-req"
,
pobj
);
this
.
esUtils
.
addEsLogs
(
settings
.
queuedName
+
"api-req"
,
pobj
.
actionBody
);
}
}
return
result
;
return
result
;
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -37,7 +37,7 @@ class APIBase {
...
@@ -37,7 +37,7 @@ class APIBase {
pobj
.
actionBody
.
requestId
=
await
this
.
getBusUid
(
"err"
);
pobj
.
actionBody
.
requestId
=
await
this
.
getBusUid
(
"err"
);
pobj
.
actionBody
.
errorInfo
=
stackStr
;
pobj
.
actionBody
.
errorInfo
=
stackStr
;
pobj
.
actionBody
.
opTitle
=
",reqPath:"
+
req
.
path
;
pobj
.
actionBody
.
opTitle
=
",reqPath:"
+
req
.
path
;
this
.
esUtils
.
addEsLogs
(
settings
.
queuedName
+
"apidoexec-error"
,
pobj
);
this
.
esUtils
.
addEsLogs
(
settings
.
queuedName
+
"apidoexec-error"
,
pobj
.
actionBody
);
return
rtnerror
;
return
rtnerror
;
}
}
}
}
...
...
brg-queue-center/app/base/db/consumer.base.js
View file @
e90cb160
...
@@ -80,10 +80,14 @@ class ConsumerBase {
...
@@ -80,10 +80,14 @@ class ConsumerBase {
}
}
execResult
=
await
this
.
subDoConsumer
(
queuedName
,
actionBody
);
execResult
=
await
this
.
subDoConsumer
(
queuedName
,
actionBody
);
}
catch
(
error
)
{
}
catch
(
error
)
{
var
stackStr
=
error
.
stack
?
error
.
stack
:
JSON
.
stringify
(
error
);
if
(
execResult
&&
execResult
.
status
==
1
)
{
this
.
errorLogDao
.
addOpErrorLogs
(
"队列执行execSubDoConsumer存在异常"
,
actionBody
,
execResult
,
stackStr
,
3
);
await
this
.
pushSuccessLogDao
.
addOpSuccessLogs
(
"推送成功"
,
actionBody
,
execResult
);
//日志记录
}
else
{
console
.
log
(
stackStr
,
",队列执行execSubDoConsumer存在异常"
);
var
stackStr
=
error
.
stack
?
error
.
stack
:
JSON
.
stringify
(
error
);
this
.
errorLogDao
.
addOpErrorLogs
(
"队列执行execSubDoConsumer存在异常"
,
actionBody
,
execResult
,
stackStr
,
3
);
//日志记录
console
.
log
(
stackStr
,
",队列执行execSubDoConsumer存在异常"
);
}
}
}
}
}
...
...
brg-queue-center/app/base/db/impl/common/connection.js
View file @
e90cb160
...
@@ -7,7 +7,7 @@ class DbFactory {
...
@@ -7,7 +7,7 @@ class DbFactory {
constructor
()
{
constructor
()
{
const
dbConfig
=
settings
.
database
();
const
dbConfig
=
settings
.
database
();
dbConfig
.
reconnect
=
{
dbConfig
.
reconnect
=
{
max_retries
:
1
0
,
max_retries
:
2
0
,
onRetry
:
function
(
count
)
{
onRetry
:
function
(
count
)
{
console
.
log
(
"connection lost, trying to reconnect ("
+
count
+
")"
);
console
.
log
(
"connection lost, trying to reconnect ("
+
count
+
")"
);
}
}
...
...
brg-queue-center/app/base/utils/esUtils.js
View file @
e90cb160
...
@@ -25,7 +25,8 @@ class EsUtils {
...
@@ -25,7 +25,8 @@ class EsUtils {
messageBody
:
actionBody
.
messageBody
||
""
,
messageBody
:
actionBody
.
messageBody
||
""
,
resultInfo
:
actionBody
.
resultInfo
||
""
,
resultInfo
:
actionBody
.
resultInfo
||
""
,
errorInfo
:
actionBody
.
errorInfo
||
""
,
errorInfo
:
actionBody
.
errorInfo
||
""
,
requestId
:
actionBody
.
requestId
requestId
:
actionBody
.
requestId
,
created_at
:
new
Date
()
}
}
var
execResult
=
await
this
.
execPostEs
(
queuedName
,
params
,
esIndexName
);
var
execResult
=
await
this
.
execPostEs
(
queuedName
,
params
,
esIndexName
);
return
execResult
;
return
execResult
;
...
...
brg-queue-center/app/config/settings.js
View file @
e90cb160
...
@@ -10,8 +10,8 @@ var ENVINPUT = {
...
@@ -10,8 +10,8 @@ var ENVINPUT = {
REDIS_DB
:
process
.
env
.
QUEUE_REDIS_DB
,
REDIS_DB
:
process
.
env
.
QUEUE_REDIS_DB
,
DB_NAME
:
process
.
env
.
QUEUE_DB_NAME
,
DB_NAME
:
process
.
env
.
QUEUE_DB_NAME
,
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"test"
,
//运行环境
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"test"
,
//运行环境
CONSUMER_NAME
:
process
.
env
.
CONSUMER_NAME
||
"public
Logs.publicLogs
Consumer"
,
//消费者名称
CONSUMER_NAME
:
process
.
env
.
CONSUMER_NAME
||
"public
ServiceAllocation.public
Consumer"
,
//消费者名称
QUEUED_NAME
:
process
.
env
.
QUEUED_NAME
||
"
LOGS-
SYTXPUBLIC-MSGQ"
,
//队列名称,FAIL-失败队列(队列和失败队列一对存在进行部署)
QUEUED_NAME
:
process
.
env
.
QUEUED_NAME
||
"SYTXPUBLIC-MSGQ"
,
//队列名称,FAIL-失败队列(队列和失败队列一对存在进行部署)
};
};
var
settings
=
{
var
settings
=
{
env
:
ENVINPUT
.
APP_ENV
,
env
:
ENVINPUT
.
APP_ENV
,
...
@@ -46,10 +46,12 @@ var settings = {
...
@@ -46,10 +46,12 @@ var settings = {
dialect
:
'mysql'
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
operatorsAliases
:
false
,
pool
:
{
pool
:
{
max
:
5
,
min
:
0
,
min
:
0
,
acquire
:
90000000
,
max
:
50
,
idle
:
1000000
idle
:
30000
,
//断开连接后,连接实例在连接池保持的时间
acquire
:
30000
,
//请求超时时间
evict
:
30000
,
handleDisconnects
:
true
},
},
timezone
:
'+08:00'
,
timezone
:
'+08:00'
,
debug
:
false
,
debug
:
false
,
...
...
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