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
b9920929
Commit
b9920929
authored
Jun 10, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
3dc9c04b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
queue-center/app/base/api/api.base.js
+1
-1
queue-center/app/base/db/consumer.base.js
+4
-0
queue-center/app/base/utils/redisClient.js
+1
-1
No files found.
queue-center/app/base/api/api.base.js
View file @
b9920929
...
@@ -16,7 +16,7 @@ class APIBase {
...
@@ -16,7 +16,7 @@ class APIBase {
var
result
=
await
this
[
methodname
](
pobj
,
query
,
req
);
var
result
=
await
this
[
methodname
](
pobj
,
query
,
req
);
pobj
.
actionBody
.
resultInfo
=
result
;
pobj
.
actionBody
.
resultInfo
=
result
;
pobj
.
actionBody
.
requestId
=
result
.
requestId
;
pobj
.
actionBody
.
requestId
=
result
.
requestId
;
this
.
esUtils
.
addEsLogs
(
settings
.
queuedName
+
"api
doexec
-info"
,
pobj
.
actionBody
);
this
.
esUtils
.
addEsLogs
(
settings
.
queuedName
+
"api
-doexecmethod
-info"
,
pobj
.
actionBody
);
return
result
;
return
result
;
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"api.base调用出现异常,请联系管理员.........."
);
console
.
log
(
e
.
stack
,
"api.base调用出现异常,请联系管理员.........."
);
...
...
queue-center/app/base/db/consumer.base.js
View file @
b9920929
...
@@ -51,20 +51,24 @@ class ConsumerBase {
...
@@ -51,20 +51,24 @@ class ConsumerBase {
actionBody
.
requestId
=
await
this
.
getBusUid
(
"PUB-"
);
actionBody
.
requestId
=
await
this
.
getBusUid
(
"PUB-"
);
if
(
queuedName
.
indexOf
(
"SYTXFAIL-SYTXPUBLIC-MSGQ"
)
<
0
)
{
if
(
queuedName
.
indexOf
(
"SYTXFAIL-SYTXPUBLIC-MSGQ"
)
<
0
)
{
execResult
=
await
this
.
subDoConsumer
(
queuedName
,
actionBody
);
execResult
=
await
this
.
subDoConsumer
(
queuedName
,
actionBody
);
console
.
log
(
execResult
,
"..........................................11......"
);
if
(
execResult
.
status
===
1
)
{
if
(
execResult
.
status
===
1
)
{
var
notifyQueuedName
=
"NOTIFY-SYTXPUBLIC-MSGQ"
;
var
notifyQueuedName
=
"NOTIFY-SYTXPUBLIC-MSGQ"
;
if
(
queuedName
.
indexOf
(
notifyQueuedName
)
<
0
)
{
if
(
queuedName
.
indexOf
(
notifyQueuedName
)
<
0
)
{
if
(
actionBody
.
notifyUrl
&&
actionBody
.
notifyUrl
.
indexOf
(
"http"
)
>
0
)
{
if
(
actionBody
.
notifyUrl
&&
actionBody
.
notifyUrl
.
indexOf
(
"http"
)
>
0
)
{
actionBody
.
resultInfo
=
execResult
;
actionBody
.
resultInfo
=
execResult
;
console
.
log
(
actionBody
,
"..............................22......."
);
await
this
.
redisClient
.
lpushData
(
notifyQueuedName
,
actionBody
);
await
this
.
redisClient
.
lpushData
(
notifyQueuedName
,
actionBody
);
}
}
}
}
console
.
log
(
actionBody
,
"........................................33......."
);
await
this
.
pushSuccessLogDao
.
addOpSuccessLogs
(
"推送成功"
,
actionBody
,
execResult
);
await
this
.
pushSuccessLogDao
.
addOpSuccessLogs
(
"推送成功"
,
actionBody
,
execResult
);
return
;
return
;
}
}
var
failQueuedName
=
"SYTXFAIL-SYTXPUBLIC-MSGQ"
;
var
failQueuedName
=
"SYTXFAIL-SYTXPUBLIC-MSGQ"
;
actionBody
.
queuedName
=
queuedName
;
actionBody
.
queuedName
=
queuedName
;
actionBody
.
counter
=
actionBody
.
counter
?
actionBody
.
counter
+
1
:
1
;
actionBody
.
counter
=
actionBody
.
counter
?
actionBody
.
counter
+
1
:
1
;
console
.
log
(
actionBody
,
"...........................................44......."
);
await
this
.
redisClient
.
lpushData
(
failQueuedName
,
actionBody
);
await
this
.
redisClient
.
lpushData
(
failQueuedName
,
actionBody
);
return
;
return
;
}
}
...
...
queue-center/app/base/utils/redisClient.js
View file @
b9920929
...
@@ -108,7 +108,7 @@ class RedisClient {
...
@@ -108,7 +108,7 @@ class RedisClient {
messageBody
=
typeof
messageBody
===
'object'
?
JSON
.
stringify
(
messageBody
)
:
messageBody
;
messageBody
=
typeof
messageBody
===
'object'
?
JSON
.
stringify
(
messageBody
)
:
messageBody
;
this
.
client
.
lpush
(
queuedName
,
messageBody
,
function
(
err
,
reply
)
{
this
.
client
.
lpush
(
queuedName
,
messageBody
,
function
(
err
,
reply
)
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
'lpush message error :'
+
err
);
console
.
log
(
'lpush message error :'
+
err
+
",queuedName:"
+
queuedName
+
",messageBody:"
+
messageBody
);
return
new
Error
(
'lpush message error :'
+
err
);
return
new
Error
(
'lpush message error :'
+
err
);
}
else
{
}
else
{
console
.
log
(
'lpush message success'
);
console
.
log
(
'lpush message success'
);
...
...
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