Skip to content

Commit

Permalink
Evict file cache before writing new entry.
Browse files Browse the repository at this point in the history
See #364.
See #359.
See #358.
See #107.
See #4.
  • Loading branch information
flatheadmill committed Aug 9, 2014
1 parent dde7836 commit bd3b542
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,12 @@ function Strata (options) {

balancer.unbalanced(page)

entry = journal.open(filename(page.address), page.position, page)
entry.ready(check(ready))
journalist.purge(check(open))

function open () {
entry = journal.open(filename(page.address), page.position, page)
entry.ready(check(ready))
}

function ready () {
writeInsert(entry, page, index, record, check(inserted, close))
Expand Down Expand Up @@ -1316,8 +1320,12 @@ function Strata (options) {

balancer.unbalanced(page)

entry = journal.open(filename(page.address), page.position, page)
entry.ready(check(ready))
journalist.purge(check(open))

function open () {
entry = journal.open(filename(page.address), page.position, page)
entry.ready(check(ready))
}

function ready () {
writeDelete(entry, page, index, check(written, close))
Expand Down

0 comments on commit bd3b542

Please sign in to comment.