Skip to content

Commit

Permalink
fixup! Queue should expire TTL milliseconds after last consumer left
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed Jan 26, 2025
1 parent e984477 commit 9992776
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/lavinmq/amqp/queue/queue.cr
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module LavinMQ::AMQP
getter consumer_timeout : UInt64? = Config.instance.consumer_timeout

@consumers_empty_change = ::Channel(Bool).new
@queue_expiration_ttl_change = ::Channel(Nil).new

private def queue_expire_loop
loop do
Expand Down Expand Up @@ -336,19 +337,6 @@ module LavinMQ::AMQP
File.delete(File.join(@data_dir, ".paused"))
end

@queue_expiration_ttl_change = ::Channel(Nil).new

private def queue_expiration_ttl : Time::Span?
if e = @expires
expires_in = e.milliseconds
if expires_in > Time::Span.zero
expires_in
else
Time::Span.zero
end
end
end

def close : Bool
return false if @closed
@closed = true
Expand Down

0 comments on commit 9992776

Please sign in to comment.