Permalink
Browse files

Explicitly close the journal file when done reading instead of waitin…

…g for the GC to do it.
  • Loading branch information...
1 parent da18a2f commit ebd4b78d031cec0fb91a90218b3517277407a55a @rcohen rcohen committed Sep 23, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/main/scala/net/lag/kestrel/Journal.scala
@@ -209,6 +209,7 @@ class Journal(queuePath: String, queueName: String, syncJournal: => Boolean, mul
f(item)
case (JournalItem.EndOfFile, _) =>
// move to next file and try again.
+ rj.close
readerFilename = Journal.journalAfter(new File(queuePath), queueName, readerFilename.get)
reader = Some(new FileInputStream(new File(queuePath, readerFilename.get)).getChannel)
fillReadBehind(f)

0 comments on commit ebd4b78

Please sign in to comment.