chore(mgmt export): use new create time in export data

This commit is contained in:
zhanghongtong 2021-04-07 09:56:04 +08:00 committed by JianBo He
parent d54643e9e1
commit ada36f5d23
2 changed files with 2 additions and 11 deletions

View File

@ -578,8 +578,8 @@ export() ->
case file:write_file(NFilename, emqx_json:encode(Data)) of case file:write_file(NFilename, emqx_json:encode(Data)) of
ok -> ok ->
case file:read_file_info(NFilename) of case file:read_file_info(NFilename) of
{ok, #file_info{size = Size, ctime = {{Y, M, D}, {H, MM, S}}}} -> {ok, #file_info{size = Size, ctime = {{Y1, M1, D1}, {H1, MM1, S1}}}} ->
CreatedAt = io_lib:format("~p-~p-~p ~p:~p:~p", [Y, M, D, H, MM, S]), CreatedAt = io_lib:format("~p-~p-~p ~p:~p:~p", [Y1, M1, D1, H1, MM1, S1]),
{ok, #{filename => list_to_binary(NFilename), {ok, #{filename => list_to_binary(NFilename),
size => Size, size => Size,
created_at => list_to_binary(CreatedAt), created_at => list_to_binary(CreatedAt),

View File

@ -71,14 +71,6 @@ init_per_testcase(data, Config) ->
application:ensure_all_started(emqx_dahboard), application:ensure_all_started(emqx_dahboard),
ok = emqx_rule_registry:mnesia(boot), ok = emqx_rule_registry:mnesia(boot),
application:ensure_all_started(emqx_rule_engine), application:ensure_all_started(emqx_rule_engine),
meck:new(emqx_sys, [passthrough, no_history]),
meck:expect(emqx_sys, version, 0,
fun() ->
Tag =os:cmd("git describe --abbrev=0 --tags") -- "\n",
re:replace(Tag, "[v|e]", "", [{return ,list}])
end),
Config; Config;
init_per_testcase(_, Config) -> init_per_testcase(_, Config) ->
@ -87,7 +79,6 @@ init_per_testcase(_, Config) ->
end_per_testcase(data, _Config) -> end_per_testcase(data, _Config) ->
application:stop(emqx_dahboard), application:stop(emqx_dahboard),
application:stop(emqx_rule_engine), application:stop(emqx_rule_engine),
meck:unload(emqx_sys),
ok; ok;
end_per_testcase(_, _Config) -> end_per_testcase(_, _Config) ->