Commit 6b6406ff by 宋毅

tj

parent 92c8111b
...@@ -21,7 +21,7 @@ class ConsumerBase { ...@@ -21,7 +21,7 @@ class ConsumerBase {
counter = 1; counter = 1;
} }
var self = this; var self = this;
this.duplicateInstance.brpop(queuedName, 0, async function (err, repl) { this.duplicateInstance.brpop(queuedName, 10800, async function (err, repl) {
if (err) { if (err) {
return new Error('doConsumer brpop error :' + err); return new Error('doConsumer brpop error :' + err);
} }
......
const system = require("../../../system");
const ConsumerBase = require("../../consumer.base"); const ConsumerBase = require("../../consumer.base");
class PublicConsumer extends ConsumerBase { class PublicConsumer extends ConsumerBase {
constructor() { constructor() {
super(ConsumerBase.getServiceName(PublicConsumer)); super(ConsumerBase.getServiceName(PublicConsumer));
this.esUtils = system.getObject("util.esUtils");
} }
async subBeforeConsumer(queuedName, actionBody) { async subBeforeConsumer(queuedName, actionBody) {
console.log("前置操作......", this.serviceName); console.log("前置操作......", this.serviceName);
...@@ -15,6 +17,15 @@ class PublicConsumer extends ConsumerBase { ...@@ -15,6 +17,15 @@ class PublicConsumer extends ConsumerBase {
requestId: actionBody.requestId requestId: actionBody.requestId
} }
var execResult = await this.execPostByTimeOut(params, actionBody.pushUrl); var execResult = await this.execPostByTimeOut(params, actionBody.pushUrl);
var tmpBody = {
"opTitle": "队列推送数据记录",// N 操作的业务标题
"identifyCode": actionBody.identifyCode || "",// Y 操作的业务标识
"indexName": "push-logs",// Y es索引值,同一个项目用一个值
"messageBody": params,
"resultInfo": execResult,//返回信息
"errorInfo": ""//错误信息
}
this.esUtils.addEsLogs(queuedName, tmpBody);
return execResult; return execResult;
} }
} }
......
var settings = {
redis: {
host: "43.247.184.32",
port: 8967,
password: "Gongsibao2018",
db: 1,
},
database: {
dbname: "tx-queue-log",
user: "write",
password: "write",
config: {
host: '43.247.184.35',
port: 8899,
dialect: 'mysql',
operatorsAliases: false,
pool: {
min: 0,
max: 50,
idle: 30000,//断开连接后,连接实例在连接池保持的时间
acquire: 30000,//请求超时时间
evict: 30000,
handleDisconnects: true
},
timezone: '+08:00',
debug: false,
dialectOptions: {
requestTimeout: 999999,
// timezone: '+8:00'
// instanceName:'DEV'
} //设置MSSQL超时时间
}
},
reqEsDevUrl: "http://192.168.4.249:9200/",
reqHomePageDevUrl: "http://zcchannel.apps.com:4003/",
reqAuthUrl: "http://sj.app.com:4002/auth"
};
module.exports = settings;
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