Skip to content

Commit

Permalink
Only log progress if long queue
Browse files Browse the repository at this point in the history
  • Loading branch information
spuun committed Oct 18, 2024
1 parent 36e793c commit 7918942
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lavinmq/queue/message_store.cr
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ module LavinMQ
# Populate bytesize, size and segment_msg_count
private def load_stats_from_segments : Nil
counter = 0
is_long_queue = @segments.size > 128
is_long_queue = @segments.size > 255
if is_long_queue
@log.info { "Loading #{@segments.size} segments" }
else
Expand All @@ -373,7 +373,11 @@ module LavinMQ
end
mfile.pos = 4
mfile.unmap # will be mmap on demand
@log.info { "Loaded #{counter}/#{@segments.size} segments" } if (counter &+= 1) % 128 == 0
if is_long_queue
@log.info { "Loaded #{counter}/#{@segments.size} segments" } if (counter &+= 1) % 128 == 0
else
@log.debug { "Loaded #{counter}/#{@segments.size} segments" } if (counter &+= 1) % 128 == 0
end
@segment_msg_count[seg] = count
end
@log.info { "Loaded #{counter} segments" }
Expand Down

0 comments on commit 7918942

Please sign in to comment.