diff --git a/apps/dgiot_device/src/utils/dgiot_device_cache.erl b/apps/dgiot_device/src/utils/dgiot_device_cache.erl index aed23891..3b50fa8c 100644 --- a/apps/dgiot_device/src/utils/dgiot_device_cache.erl +++ b/apps/dgiot_device/src/utils/dgiot_device_cache.erl @@ -42,7 +42,7 @@ parse_cache_Device(_ClassName) -> end, Query = #{ <<"order">> => <<"updatedAt">>, - <<"keys">> => [<<"ACL">>, <<"updatedAt">>, <<"devaddr">>, <<"status">>, <<"isEnable">>, <<"profile">>, <<"product">>, <<"location">>, <<"deviceSecret">>], + <<"keys">> => [<<"ACL">>, <<"updatedAt">>, <<"state">>, <<"devaddr">>, <<"status">>, <<"isEnable">>, <<"profile">>, <<"product">>, <<"location">>, <<"deviceSecret">>], <<"where">> => #{} }, dgiot_parse_loader:start(<<"Device">>, Query, 0, 100, 1000000, Success). diff --git a/apps/dgiot_tdengine/src/dgiot_tdengine_channel.erl b/apps/dgiot_tdengine/src/dgiot_tdengine_channel.erl index 8f5840ec..d334c5a6 100644 --- a/apps/dgiot_tdengine/src/dgiot_tdengine_channel.erl +++ b/apps/dgiot_tdengine/src/dgiot_tdengine_channel.erl @@ -227,7 +227,13 @@ handle_message({data, Product, DevAddr, Data, Context}, #state{id = ChannelId} = %% 数据与产品,设备地址分离 handle_message({sql, Sql}, #state{id = ChannelId} = State) -> dgiot_metrics:inc(dgiot_tdengine, <<"tdengine_recv">>, 1), - dgiot_tdengine:batch_sql(ChannelId, Sql), + case catch dgiot_tdengine:batch_sql(ChannelId, Sql) of + {Err, Reason} when Err == error; Err == 'EXIT' -> + dgiot_bridge:send_log(ChannelId, "Save to Tdengine error, ~p, ~p", [Sql, Reason]), + ok; + _ -> + pass + end, {ok, State}; %% 规则引擎导入 diff --git a/apps/dgiot_zhcltech b/apps/dgiot_zhcltech index 9303052c..2ace04be 160000 --- a/apps/dgiot_zhcltech +++ b/apps/dgiot_zhcltech @@ -1 +1 @@ -Subproject commit 9303052c9aee6e4f9cc38249a1e800e686c4c775 +Subproject commit 2ace04bea5a1e77fee19bbe189a76e40f55c862f