This commit is contained in:
anlicheng 2024-08-30 15:04:30 +08:00
parent dabb9aee2f
commit 4e938f04e1
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,5 @@
[ [
{super_device_uuids, [ {super_device_uuids, [
{name, <<"test">>} <<"29717641877153792017243119445063">>
]} ]}
]. ].

View File

@ -22,12 +22,14 @@
new() -> new() ->
ets:new(iot_env, [public, set, named_table, {read_concurrency, true}, {keypos, 2}]), ets:new(iot_env, [public, set, named_table, {read_concurrency, true}, {keypos, 2}]),
Envs = load_env(), Envs = load_env(),
lager:debug("[iot_env] load envs: ~p", [Envs]),
[ets:insert(iot_env, #env{key = Key, val = Val}) || {Key, Val} <- Envs], [ets:insert(iot_env, #env{key = Key, val = Val}) || {Key, Val} <- Envs],
ok. ok.
-spec reload() -> ok. -spec reload() -> ok.
reload() -> reload() ->
Envs = load_env(), Envs = load_env(),
lager:debug("[iot_env] load envs: ~p", [Envs]),
[ets:insert(iot_env, #env{key = Key, val = Val}) || {Key, Val} <- Envs], [ets:insert(iot_env, #env{key = Key, val = Val}) || {Key, Val} <- Envs],
ok. ok.