diff --git a/rebar.config b/rebar.config index ad3b589f98a..6165bfa44a0 100644 --- a/rebar.config +++ b/rebar.config @@ -70,7 +70,7 @@ {flatlog, "0.1.2"}, %%% Stateless libraries - {opuntia, "0.3.0"}, + {opuntia, "1.0.0"}, {fast_tls, "1.1.16"}, {fast_scram, "0.5.0"}, {idna, "6.1.1"}, diff --git a/rebar.lock b/rebar.lock index bf855d3b449..9756e8223fa 100644 --- a/rebar.lock +++ b/rebar.lock @@ -94,7 +94,7 @@ {ref,"c71265c00bd7b465b7214770895503383dbe299e"}}, 0}, {<<"observer_cli">>,{pkg,<<"observer_cli">>,<<"1.7.4">>},0}, - {<<"opuntia">>,{pkg,<<"opuntia">>,<<"0.3.0">>},0}, + {<<"opuntia">>,{pkg,<<"opuntia">>,<<"1.0.0">>},0}, {<<"p1_utils">>,{pkg,<<"p1_utils">>,<<"1.0.25">>},1}, {<<"pa">>, {git,"https://github.com/erszcz/pa.git", @@ -171,7 +171,7 @@ {<<"mimerl">>, <<"67E2D3F571088D5CFD3E550C383094B47159F3EEE8FFA08E64106CDF5E981BE3">>}, {<<"mysql">>, <<"0E4BBCF701B7D8EA5C3750F220F26323C0FC18B844960988BE196B33A8A9F3C1">>}, {<<"observer_cli">>, <<"3C1BFB6D91BF68F6A3D15F46AE20DA0F7740D363EE5BC041191CE8722A6C4FAE">>}, - {<<"opuntia">>, <<"FB365A48C48CEE76C76407FB0B0E13065E6CB23F4918F7C6B084499FAEB1CCDF">>}, + {<<"opuntia">>, <<"046612F0797E58893F644C7DCCBDA54D3987F786F0B131F5DE82EAE330EEA7CD">>}, {<<"p1_utils">>, <<"2D39B5015A567BBD2CC7033EEB93A7C60D8C84EFE1EF69A3473FAA07FA268187">>}, {<<"parse_trans">>, <<"BB87AC362A03CA674EBB7D9D498F45C03256ADED7214C9101F7035EF44B798C7">>}, {<<"pooler">>, <<"898CD1FA301FC42D4A8ED598CE139B71CA85B54C16AB161152B5CC5FBDCFA1A8">>}, @@ -235,7 +235,7 @@ {<<"mimerl">>, <<"F278585650AA581986264638EBF698F8BB19DF297F66AD91B18910DFC6E19323">>}, {<<"mysql">>, <<"D473C479C19E5CDE20237458EEAD6673C3C00E0EF84AFD30615AEBBB67FEE7B3">>}, {<<"observer_cli">>, <<"50DE6D95D814F447458BD5D72666A74624EDDB0EF98BDCEE61A0153AAE0865FF">>}, - {<<"opuntia">>, <<"AB49DB4DA96D30116C85A6D28AC4D6C4BE9C91799D7E2452C37F92C477B9BB88">>}, + {<<"opuntia">>, <<"C0C6144E136B9A3AC8CB6EB8DCEC44AA419F23716B3BE0C9A16EDC2B486E3513">>}, {<<"p1_utils">>, <<"9219214428F2C6E5D3187FF8EB9A8783695C2427420BE9A259840E07ADA32847">>}, {<<"parse_trans">>, <<"F99E368830BEA44552224E37E04943A54874F08B8590485DE8D13832B63A2DC3">>}, {<<"pooler">>, <<"058D85C5081289B90E97E4DDDBC3BB5A3B4A19A728AB3BC88C689EFCC36A07C7">>}, diff --git a/src/mongoose_shaper.erl b/src/mongoose_shaper.erl index 4fb9dc8c92f..860af698ecd 100644 --- a/src/mongoose_shaper.erl +++ b/src/mongoose_shaper.erl @@ -60,8 +60,8 @@ get_shaper_name(HostType, Domain, Action, FromJID) -> get_shaper_config(Name) -> case mongoose_config:lookup_opt([shaper, Name]) of {ok, #{max_rate := MaxRatePerSecond}} -> - Rate = MaxRatePerSecond div 1000, - #{bucket_size => MaxRatePerSecond, rate => Rate, start_full => true}; + #{bucket_size => MaxRatePerSecond, rate => MaxRatePerSecond, + time_unit => second, start_full => true}; {error, not_found} -> 0 end.