Skip to content

Commit 18035dc

Browse files
authored
chore: remove unnecessary calculation (#268)
1 parent 37a1a56 commit 18035dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/redis_client/cluster/concurrent_worker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def initialize(worker:, size:)
3939
end
4040

4141
def push(id, *args, **kwargs, &block)
42-
raise InvalidNumberOfTasks, "expected: #{@result_queue.max}, actual: #{@count + 1}" if @count + 1 > @result_queue.max
42+
raise InvalidNumberOfTasks, "max size reached: #{@count}" if @count == @result_queue.max
4343

4444
task = Task.new(id: id, queue: @result_queue, args: args, kwargs: kwargs, block: block)
4545
@worker.push(task)

0 commit comments

Comments
 (0)