Skip to content

Commit

Permalink
count publish_in before dedup check
Browse files Browse the repository at this point in the history
  • Loading branch information
snichme committed Nov 27, 2024
1 parent 0917d34 commit 159eeca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lavinmq/exchange/exchange.cr
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ module LavinMQ
def publish(msg : Message, immediate : Bool,
queues : Set(Queue) = Set(Queue).new,
exchanges : Set(Exchange) = Set(Exchange).new) : Int32
@publish_in_count += 1
if d = @deduper
if d.duplicate?(msg)
@dedup_count += 1
return 0
end
d.add(msg)
end
@publish_in_count += 1
count = do_publish(msg, immediate, queues, exchanges)
@unroutable_count += 1 if count.zero?
@publish_out_count += count
Expand Down

0 comments on commit 159eeca

Please sign in to comment.