Commit 325d0b203dd4d900ea2377693f19b12d65cedfd7
1 parent
75b6ea89
修复mq崩溃的bug
Showing
1 changed file
with
10 additions
and
0 deletions
src/ai_platform/MultiSourceProcess.cpp
@@ -156,6 +156,10 @@ int CMultiSourceProcess::InitAlgorthim(tsl_aiplatform_param vptParam){ | @@ -156,6 +156,10 @@ int CMultiSourceProcess::InitAlgorthim(tsl_aiplatform_param vptParam){ | ||
156 | m_snapshot_reprocessing = new snapshot_reprocessing(m_devId); | 156 | m_snapshot_reprocessing = new snapshot_reprocessing(m_devId); |
157 | m_save_snapshot_reprocessing = new save_snapshot_reprocessing(m_devId); | 157 | m_save_snapshot_reprocessing = new save_snapshot_reprocessing(m_devId); |
158 | 158 | ||
159 | +#ifdef POST_USE_RABBITMQ | ||
160 | + mq_manager_ = new mq::Manager(); | ||
161 | +#endif | ||
162 | + | ||
159 | VPCUtil* pVpcUtil = VPCUtil::getInstance(); | 163 | VPCUtil* pVpcUtil = VPCUtil::getInstance(); |
160 | pVpcUtil->init(m_devId); | 164 | pVpcUtil->init(m_devId); |
161 | 165 | ||
@@ -191,6 +195,12 @@ int CMultiSourceProcess::InitAlgorthim(tsl_aiplatform_param vptParam){ | @@ -191,6 +195,12 @@ int CMultiSourceProcess::InitAlgorthim(tsl_aiplatform_param vptParam){ | ||
191 | /* MQ队列的初始化 */ | 195 | /* MQ队列的初始化 */ |
192 | int CMultiSourceProcess::AddMqConn(mq_type_t mq_type, rabbitmq_conn_params_t mq_conn_param) { | 196 | int CMultiSourceProcess::AddMqConn(mq_type_t mq_type, rabbitmq_conn_params_t mq_conn_param) { |
193 | /* 初始化MQ队列 */ | 197 | /* 初始化MQ队列 */ |
198 | + LOG_INFO("初始化MQ队列"); | ||
199 | + if(mq_manager_ == nullptr){ | ||
200 | + LOG_ERROR("mq_manager_ is null"); | ||
201 | + return FAILED; | ||
202 | + } | ||
203 | + | ||
194 | if (!mq_manager_->add_conn(mq_type, mq_conn_param)) { | 204 | if (!mq_manager_->add_conn(mq_type, mq_conn_param)) { |
195 | LOG_ERROR("Connection MQ failed, ip: {} port: {} uname: {} passwd: {}", mq_conn_param.ip, mq_conn_param.port, | 205 | LOG_ERROR("Connection MQ failed, ip: {} port: {} uname: {} passwd: {}", mq_conn_param.ip, mq_conn_param.port, |
196 | mq_conn_param.uname, mq_conn_param.passwd); | 206 | mq_conn_param.uname, mq_conn_param.passwd); |