async-flumelog
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -32,3 +32,3 @@ const Cache = require('hashlru') | ||
raf.stat(function (err, stat) { | ||
if (err) console.error("failed to stat " + filename, err) | ||
if (err) debug("failed to stat " + filename, err) | ||
@@ -35,0 +35,0 @@ var len = stat ? stat.size : -1 |
{ | ||
"name": "async-flumelog", | ||
"description": "An async flumelog", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"homepage": "https://github.com/flumedb/async-flumelog", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -30,3 +30,3 @@ # Async flumelog | ||
Writing to the log is always async. Note this is different from | ||
[flumelog-offset] and [flumelog-aligned-offfset]. The `since` observable | ||
[flumelog-offset] and [flumelog-aligned-offset]. The `since` observable | ||
will be updated once the data is written. The `onDrain` callback can be used to | ||
@@ -33,0 +33,0 @@ know when data has been written if needed. Streaming will only emit |
@@ -113,4 +113,8 @@ var ltgt = require('ltgt') | ||
if (this.ended && !this.sink.ended) | ||
return this.sink.end(this.ended === true ? null : this.ended) | ||
if (this.ended && !this.sink.ended) { | ||
if (this.ended === true && !this.live) | ||
return this.abort() | ||
else | ||
return this.sink.end(this.ended === true ? null : this.ended) | ||
} | ||
@@ -117,0 +121,0 @@ if (this.cursor === -1) |
@@ -79,3 +79,4 @@ var tape = require('tape') | ||
}) | ||
log.stream({live: true, seqs: false}).pipe(sink) | ||
let ls = log.stream({live: true, seqs: false}) | ||
ls.pipe(sink) | ||
log.append(v3, function (err) {}) | ||
@@ -85,2 +86,3 @@ log.onDrain(function () { | ||
sink.end('tape-ended') | ||
ls.abort() | ||
t.end() | ||
@@ -152,3 +154,4 @@ }) | ||
}) | ||
log.stream({ live: true, seqs: false, gt: 10 + 2 + 20 + 2 }).pipe(sink) | ||
let ls = log.stream({ live: true, seqs: false, gt: 10 + 2 + 20 + 2 }) | ||
ls.pipe(sink) | ||
log.append(v4, function (err) {}) | ||
@@ -160,2 +163,3 @@ log.onDrain(() => { | ||
sink.end('tape-ended') | ||
ls.abort() | ||
t.end() | ||
@@ -189,9 +193,11 @@ }, 200) | ||
tape('close', function (t) { | ||
t.equal(log.streams.length, 0, 'no open streams') | ||
log.stream({seqs: false}).pipe({ | ||
paused: false, | ||
write: function () { }, | ||
write: function () {}, | ||
end: function() { | ||
t.end() | ||
} | ||
}) | ||
log.close(() => { | ||
t.end() | ||
}) | ||
log.close(() => {}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46401
1084