hyperdrive
Advanced tools
Comparing version 11.1.0 to 11.1.1
15
index.js
@@ -19,3 +19,3 @@ const Hyperbee = require('hyperbee') | ||
} | ||
const { _checkout, _db, _files, onwait } = opts | ||
const { _checkout, _db, _files, onwait, readonly } = opts | ||
this._onwait = onwait || null | ||
@@ -31,2 +31,3 @@ | ||
this._openingBlobs = null | ||
this._readonly = !!readonly | ||
this._checkout = _checkout || null | ||
@@ -85,2 +86,3 @@ this._batching = !!_files | ||
onwait: this._onwait, | ||
readable: this._readonly, | ||
_checkout: this._checkout || this, | ||
@@ -99,2 +101,3 @@ _db: snapshot, | ||
onwait: this._onwait, | ||
readable: this._readonly, | ||
_checkout: null, | ||
@@ -106,8 +109,8 @@ _db: this.db, | ||
flush () { | ||
return this.files.flush() | ||
async flush () { | ||
await this.files.flush() | ||
return this.close() | ||
} | ||
async _close () { | ||
if (this._batching) return this.files.close() | ||
try { | ||
@@ -117,3 +120,3 @@ if (this.blobs !== null && (this._checkout === null || this.blobs !== this._checkout.blobs)) { | ||
} | ||
await this.db.close() | ||
if (!this._batching) await this.db.close() | ||
await this.files.close() // workaround to flush the batches for now. TODO: kill the sub! | ||
@@ -124,3 +127,3 @@ } catch (e) { | ||
if (this._checkout) return | ||
if (this._checkout || this._batching) return | ||
try { | ||
@@ -127,0 +130,0 @@ await this.corestore.close() |
{ | ||
"name": "hyperdrive", | ||
"version": "11.1.0", | ||
"version": "11.1.1", | ||
"description": "Hyperdrive is a secure, real-time distributed file system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
35660
431