From 90dd5db216d923b8d3e6216e0ad01884d6217c93 Mon Sep 17 00:00:00 2001 From: Magnus Landerblom Date: Fri, 22 Nov 2024 11:07:17 +0100 Subject: [PATCH] Update src/lavinmq/exchange/dedup_ext.cr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christina Dahlén <85930202+kickster97@users.noreply.github.com> --- src/lavinmq/exchange/dedup_ext.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lavinmq/exchange/dedup_ext.cr b/src/lavinmq/exchange/dedup_ext.cr index cdf6eb059b..58869e41d2 100644 --- a/src/lavinmq/exchange/dedup_ext.cr +++ b/src/lavinmq/exchange/dedup_ext.cr @@ -20,7 +20,7 @@ module LavinMQ end def insert(key : T, ttl : UInt32? = nil) - @store.delete(@store.first_key) if @store.size >= @size + @store.shift if @store.size >= @size @store[key] = ttl ? RoughTime.unix_ms + ttl : nil end end