Commit 325d0b203dd4d900ea2377693f19b12d65cedfd7

Authored by Hu Chunming
1 parent 75b6ea89

修复mq崩溃的bug

src/ai_platform/MultiSourceProcess.cpp
... ... @@ -156,6 +156,10 @@ int CMultiSourceProcess::InitAlgorthim(tsl_aiplatform_param vptParam){
156 156 m_snapshot_reprocessing = new snapshot_reprocessing(m_devId);
157 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 163 VPCUtil* pVpcUtil = VPCUtil::getInstance();
160 164 pVpcUtil->init(m_devId);
161 165  
... ... @@ -191,6 +195,12 @@ int CMultiSourceProcess::InitAlgorthim(tsl_aiplatform_param vptParam){
191 195 /* MQ队列的初始化 */
192 196 int CMultiSourceProcess::AddMqConn(mq_type_t mq_type, rabbitmq_conn_params_t mq_conn_param) {
193 197 /* 初始化MQ队列 */
  198 + LOG_INFO("初始化MQ队列");
  199 + if(mq_manager_ == nullptr){
  200 + LOG_ERROR("mq_manager_ is null");
  201 + return FAILED;
  202 + }
  203 +
194 204 if (!mq_manager_->add_conn(mq_type, mq_conn_param)) {
195 205 LOG_ERROR("Connection MQ failed, ip: {} port: {} uname: {} passwd: {}", mq_conn_param.ip, mq_conn_param.port,
196 206 mq_conn_param.uname, mq_conn_param.passwd);
... ...