Browse Source

Merge pull request #9584 from kjellwinblad/kjell/fix_jq_dont_start_port_programs_when_they_are_not_needed

fix: do not start jq port programs when they are not needed
Zaiming (Stone) Shi 3 năm trước cách đây
mục cha
commit
f19d649c11
2 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 2 2
      mix.exs
  2. 3 1
      rebar.config.erl

+ 2 - 2
mix.exs

@@ -248,7 +248,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: []
@@ -519,7 +519,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

+ 3 - 1
rebar.config.erl

@@ -397,7 +397,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).