fix: api file path with filename:join(List) & app up
This commit is contained in:
parent
2da3333879
commit
1ec0377a69
|
@ -1,6 +1,6 @@
|
|||
{application, emqx_plugin_libs,
|
||||
[{description, "EMQ X Plugin utility libs"},
|
||||
{vsn, "4.4.1"},
|
||||
{vsn, "4.4.2"},
|
||||
{modules, []},
|
||||
{applications, [kernel,stdlib]},
|
||||
{env, []}
|
||||
|
|
|
@ -1,12 +1,24 @@
|
|||
%% -*- mode: erlang -*-
|
||||
{VSN,
|
||||
[{"4.4.0",
|
||||
[ {update, emqx_slow_subs, {advanced, ["4.4.0"]}}
|
||||
[{"4.4.1",
|
||||
[ {load_module,emqx_trace,brutal_purge,soft_purge,[]}
|
||||
, {load_module,emqx_trace_api,brutal_purge,soft_purge,[]}
|
||||
]},
|
||||
{"4.4.0",
|
||||
[ {load_module,emqx_trace,brutal_purge,soft_purge,[]}
|
||||
, {load_module,emqx_trace_api,brutal_purge,soft_purge,[]}
|
||||
, {update, emqx_slow_subs, {advanced, ["4.4.0"]}}
|
||||
, {load_module,emqx_slow_subs_api,brutal_purge,soft_purge,[]}
|
||||
]},
|
||||
{<<".*">>,[]}],
|
||||
[{"4.4.0",
|
||||
[ {update, emqx_slow_subs, {advanced, ["4.4.0"]}}
|
||||
[{"4.4.1",
|
||||
[ {load_module,emqx_trace,brutal_purge,soft_purge,[]}
|
||||
, {load_module,emqx_trace_api,brutal_purge,soft_purge,[]}
|
||||
]},
|
||||
{"4.4.0",
|
||||
[ {load_module,emqx_trace,brutal_purge,soft_purge,[]}
|
||||
, {load_module,emqx_trace_api,brutal_purge,soft_purge,[]}
|
||||
, {update, emqx_slow_subs, {advanced, ["4.4.0"]}}
|
||||
, {load_module,emqx_slow_subs_api,brutal_purge,soft_purge,[]}
|
||||
]},
|
||||
{<<".*">>,[]}]
|
||||
|
|
|
@ -95,7 +95,8 @@ download_zip_log(#{name := Name}, _Param) ->
|
|||
TraceFiles = collect_trace_file(TraceLog),
|
||||
ZipDir = emqx_trace:zip_dir(),
|
||||
Zips = group_trace_file(ZipDir, TraceLog, TraceFiles),
|
||||
ZipFileName = ZipDir ++ binary_to_list(Name) ++ ".zip",
|
||||
ZipFileName0 = binary_to_list(Name) ++ ".zip",
|
||||
ZipFileName = filename:join([Zips, ZipFileName0]),
|
||||
{ok, ZipFile} = zip:zip(ZipFileName, Zips, [{cwd, ZipDir}]),
|
||||
emqx_trace:delete_files_after_send(ZipFileName, Zips),
|
||||
{ok, ZipFile};
|
||||
|
@ -107,9 +108,10 @@ group_trace_file(ZipDir, TraceLog, TraceFiles) ->
|
|||
lists:foldl(fun(Res, Acc) ->
|
||||
case Res of
|
||||
{ok, Node, Bin} ->
|
||||
ZipName = ZipDir ++ Node ++ "-" ++ TraceLog,
|
||||
FileName = Node ++ "-" ++ TraceLog,
|
||||
ZipName = filename:join([ZipDir, FileName]),
|
||||
case file:write_file(ZipName, Bin) of
|
||||
ok -> [Node ++ "-" ++ TraceLog | Acc];
|
||||
ok -> [FileName | Acc];
|
||||
_ -> Acc
|
||||
end;
|
||||
{error, Node, Reason} ->
|
||||
|
|
Loading…
Reference in New Issue