Skip to content

Commit fb8feab

Browse files
committed
[update] StackFlow add default serial_zmq_url
1 parent bc70332 commit fb8feab

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.vscode/settings.json
2+
projects/core135_llm_product_test_ui

ext_components/StackFlow/stackflow/StackFlow.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,19 @@ StackFlow::StackFlow::StackFlow(const std::string &unit_name)
188188

189189
status_.store(0);
190190
exit_flage_.store(false);
191-
even_loop_thread_ = std::make_unique<std::thread>(std::bind(&StackFlow::even_loop, this));
192-
event_queue_.enqueue(EVENT_SYS_INIT, "", "");
191+
even_loop_thread_ = std::make_unique<std::thread>(std::bind(&StackFlow::even_loop, this));
192+
llm_channel_obj::uart_push_url = std::string("ipc:///tmp/llm/5556.sock");
193+
status_.store(1);
194+
repeat_event(1000, [this]() {
195+
std::string serial_zmq_url = this->sys_sql_select("serial_zmq_url");
196+
if (!serial_zmq_url.empty()) {
197+
SLOGI("serial_zmq_url:%s", serial_zmq_url.c_str());
198+
llm_channel_obj::uart_push_url = serial_zmq_url;
199+
return 0;
200+
} else {
201+
return 1;
202+
}
203+
});
193204
}
194205

195206
StackFlow::~StackFlow()
@@ -222,17 +233,7 @@ void StackFlow::_none_event(const std::string &data1, const std::string &data2)
222233

223234
void StackFlow::_sys_init(const std::string &zmq_url, const std::string &data)
224235
{
225-
// serial_zmq_url
226-
std::string serial_zmq_url;
227-
serial_zmq_url = sys_sql_select("serial_zmq_url");
228-
if (!serial_zmq_url.empty()) {
229-
SLOGI("serial_zmq_url:%s", serial_zmq_url.c_str());
230-
llm_channel_obj::uart_push_url = serial_zmq_url;
231-
status_.store(1);
232-
} else {
233-
sleep(1);
234-
event_queue_.enqueue(EVENT_SYS_INIT, "", "");
235-
}
236+
// todo:...
236237
}
237238

238239
std::string StackFlow::_rpc_setup(pzmq *_pzmq, const std::string &data)

0 commit comments

Comments
 (0)