We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c717c4 commit 4e60556Copy full SHA for 4e60556
src/rabbit_limiter.erl
@@ -324,12 +324,12 @@ prioritise_call(_Msg, _From, _Len, _State) -> 0.
324
handle_call({new, ChPid}, _From, State = #lim{ch_pid = undefined}) ->
325
{reply, ok, State#lim{ch_pid = ChPid}};
326
327
-handle_call({limit_prefetch, PrefetchCount, UnackedCount}, _From, State) ->
328
- %% assertion
329
- true = State#lim.prefetch_count == 0 orelse
330
- State#lim.volume == UnackedCount,
+handle_call({limit_prefetch, PrefetchCount, UnackedCount}, _From,
+ State = #lim{prefetch_count = 0}) ->
331
{reply, ok, maybe_notify(State, State#lim{prefetch_count = PrefetchCount,
332
volume = UnackedCount})};
+handle_call({limit_prefetch, PrefetchCount, _UnackedCount}, _From, State) ->
+ {reply, ok, maybe_notify(State, State#lim{prefetch_count = PrefetchCount})};
333
334
handle_call(unlimit_prefetch, _From, State) ->
335
{reply, ok, maybe_notify(State, State#lim{prefetch_count = 0,
0 commit comments