-
Notifications
You must be signed in to change notification settings - Fork 34
Conversation
This command needs access to RabbitMQ modules and currently propagation doesn't work as expected.
This correctly handles the case where the rabbit app is already loaded. References #178.
def validate(_, _), do: {:validation_failure, :too_many_args} | ||
|
||
def run([target_dir], _opts) do | ||
case Application.load(:rabbit) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do Application.load
again?
It should be called during validation.
{:error, {:already_loaded, :rabbit}} -> | ||
Code.ensure_loaded(:rabbit_hipe) | ||
hipe_compile(target_dir) | ||
:ok; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An error message from the previous line will never be shown.
defp hipe_compile(target_dir) do | ||
case :rabbit_hipe.can_hipe_compile() do | ||
true -> | ||
{:ok, _, _} = :rabbit_hipe.compile_to_directory(target_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ok, already_compiled}
will not be matched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally, it won't be returned, because compile_to_directory
will clean the directory before compiling, but the code is in different repo and the change can easily slip through the cracks.
Empty string for directory crashes the command
|
…cient permissions References #178.
Originally introduced in rabbitmq/rabbitmq-server#808.
Fixes #178.