Просмотр исходного кода

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

zhanghongtong 5 лет назад
Родитель
Сommit
ada36f5d23

+ 2 - 2
apps/emqx_management/src/emqx_mgmt_data_backup.erl

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

+ 0 - 9
apps/emqx_management/test/emqx_mgmt_api_SUITE.erl

@@ -71,14 +71,6 @@ init_per_testcase(data, Config) ->
     application:ensure_all_started(emqx_dahboard),
     ok = emqx_rule_registry:mnesia(boot),
     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;
 
 init_per_testcase(_, Config) ->
@@ -87,7 +79,6 @@ init_per_testcase(_, Config) ->
 end_per_testcase(data, _Config) ->
     application:stop(emqx_dahboard),
     application:stop(emqx_rule_engine),
-    meck:unload(emqx_sys),
     ok;
 
 end_per_testcase(_, _Config) ->