Skip to content

Commit

Permalink
feat(journal): use new assert machinary
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Jan 27, 2022
1 parent e9fbbbd commit 3a2812c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/journal/src/Journal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ startJournal fp (Options termLength) = do

appendBS :: Journal -> ByteString -> IO (Maybe ())
appendBS jour bs = do
-- XXX: use new assertM
-- assertM $ do
-- termBufferLen <- int322Int <$> readTermLength (jMetadata jour)
-- 0 < BS.length bs && hEADER_LENGTH + BS.length bs < termBufferLen / 2
assertIO $ do
termBufferLen <- int322Int <$> readTermLength (jMetadata jour)
return (0 < BS.length bs && hEADER_LENGTH + BS.length bs < termBufferLen `div` 2)
let len = BS.length bs
mClaim <- tryClaim jour len
case mClaim of
Expand Down

0 comments on commit 3a2812c

Please sign in to comment.