Skip to content

Commit

Permalink
Merge pull request #40 from dfed/dfed--bugfix
Browse files Browse the repository at this point in the history
Ensure overwriting cache can always read the full cache
  • Loading branch information
dfed committed Apr 24, 2020
2 parents b0f588d + 2bf6010 commit d6cfc12
Show file tree
Hide file tree
Showing 4 changed files with 553 additions and 255 deletions.
2 changes: 1 addition & 1 deletion CacheAdvance.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'CacheAdvance'
s.version = '1.0.0'
s.version = '1.0.1'
s.license = 'Apache License, Version 2.0'
s.summary = 'A cache that enables the performant persistence of individual messages to disk'
s.homepage = 'https://github.com/dfed/CacheAdvance'
Expand Down
2 changes: 1 addition & 1 deletion Sources/CacheAdvance/CacheAdvance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public final class CacheAdvance<T: Codable> {
/// - Parameter messageLength: the length of the next message that will be written.
private func prepareReaderForWriting(dataOfLength messageLength: Bytes) throws {
while writer.offsetInFile < reader.offsetInFile
&& reader.offsetInFile < writer.offsetInFile + messageLength
&& reader.offsetInFile <= writer.offsetInFile + messageLength
{
// The current position of the writer is before the oldest message, which means that writing this message would write into the current message.
// Advance to the next message.
Expand Down
Loading

0 comments on commit d6cfc12

Please sign in to comment.