diff options
| -rw-r--r-- | src/rabbit_resource_monitor_misc.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rabbit_resource_monitor_misc.erl b/src/rabbit_resource_monitor_misc.erl index 88f3bd1121..e0bb1e98d6 100644 --- a/src/rabbit_resource_monitor_misc.erl +++ b/src/rabbit_resource_monitor_misc.erl @@ -30,9 +30,11 @@ parse_information_unit(Value) when is_integer(Value) -> {ok, Value}; parse_information_unit(Value) when is_list(Value) -> case re:run(Value, "^(?<VAL>[0-9]+)(?<UNIT>kB|KB|MB|GB|kb|mb|gb|Kb|Mb|Gb|kiB|KiB|MiB|GiB|kib|mib|gib|KIB|MIB|GIB|k|K|m|M|g|G)?$", - [{capture, all_names, list}]) of + [{capture, all_but_first, list}]) of {match, [[], _]} -> {ok, list_to_integer(Value)}; + {match, [Num]} -> + {ok, list_to_integer(Value)}; {match, [Unit, Num]} -> Multiplier = case Unit of KiB when KiB =:= "k"; KiB =:= "kiB"; KiB =:= "K"; KiB =:= "KIB"; KiB =:= "kib" -> 1024; |
