fix: do not start jq port programs when they are not needed

The jq function in the rule engine uses the jq NIF implementation by
default so there is often no need to start any jq port programs. Before
this commit jq port programs were started anyway. This is fixed by not
starting the jq application (the jq application is started automatically
when the jq port implementation is activated).
This commit is contained in:
Kjell Winblad 2022-12-20 11:16:57 +01:00
parent bfe2b67fbe
commit 75021b376e
2 changed files with 5 additions and 3 deletions

View File

@ -247,7 +247,7 @@ defmodule EMQXUmbrella.MixProject do
] ++
if(enable_quicer?(), do: [quicer: :permanent], else: []) ++
if(enable_bcrypt?(), do: [bcrypt: :permanent], else: []) ++
if(enable_jq?(), do: [jq: :permanent], else: []) ++
if(enable_jq?(), do: [jq: :load], else: []) ++
if(is_app(:observer),
do: [observer: :load],
else: []
@ -518,7 +518,7 @@ defmodule EMQXUmbrella.MixProject do
|> Path.join("RELEASES")
|> File.open!([:write, :utf8], fn handle ->
IO.puts(handle, "%% coding: utf-8")
:io.format(handle, '~tp.~n', [release_entry])
:io.format(handle, ~c"~tp.~n", [release_entry])
end)
release

View File

@ -398,7 +398,9 @@ relx_apps(ReleaseType, Edition) ->
] ++
[quicer || is_quicer_supported()] ++
[bcrypt || provide_bcrypt_release(ReleaseType)] ++
[jq || is_jq_supported()] ++
%% Started automatically when needed (only needs to be started when the
%% port implementation is used)
[{jq, load} || is_jq_supported()] ++
[{observer, load} || is_app(observer)] ++
relx_apps_per_edition(Edition).