mirror of
https://github.com/emqx/neuron.git
synced 2026-10-27 04:19:50 +08:00
fix(adapter): the adapter state does not enter ready
This commit is contained in:
@@ -1444,7 +1444,6 @@ int adapter_loop(enum neu_event_io_type type, int fd, void *usr_data)
|
||||
case MSG_CMD_RESP_PONG: {
|
||||
char *buf_ptr = msg_get_buf_ptr(pay_msg);
|
||||
|
||||
adapter->state = ADAPTER_STATE_INIT;
|
||||
log_info("Adapter(%s) received pong: %s\n", adapter->name, buf_ptr);
|
||||
break;
|
||||
}
|
||||
@@ -1851,6 +1850,9 @@ int neu_adapter_init(neu_adapter_t *adapter)
|
||||
buf_ptr[strlen(adapter->name)] = 0;
|
||||
nng_sendmsg(adapter->nng.sock, out_msg, 0);
|
||||
}
|
||||
if (adapter->state == ADAPTER_STATE_IDLE) {
|
||||
adapter->state = ADAPTER_STATE_INIT;
|
||||
}
|
||||
adapter->plugin_info.module->intf_funs->init(adapter->plugin_info.plugin);
|
||||
return rv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user