Skip to content

Commit

Permalink
use old_consumer_offsets.path
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorerlingsson committed Jun 19, 2024
1 parent 6c66ad8 commit ec8c733
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lavinmq/queue/stream_queue_message_store.cr
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ module LavinMQ

def replace_offsets_file(&)
old_consumer_offsets = @consumer_offsets
@consumer_offsets = MFile.new("#{@consumer_offsets.path}.tmp", 32 * 1024)
@consumer_offsets = MFile.new("#{old_consumer_offsets.path}.tmp", 32 * 1024)
yield # fill the new file with correct data in this block
@consumer_offsets.rename(@consumer_offsets.path.sub(".tmp",""))
@consumer_offsets.rename(old_consumer_offsets.path)
old_consumer_offsets.close(truncate_to_size: false)
end

Expand Down

0 comments on commit ec8c733

Please sign in to comment.