@cypsela/sailplane-node
Advanced tools
Comparing version 2.1.1 to 2.1.2
{ | ||
"name": "@cypsela/sailplane-node", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "collaborative file system on ipfs", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -50,2 +50,7 @@ | ||
const statsFirst = (...p) => [...p.slice(-2) , ...p.slice(0, -2)] | ||
this._dbProgress = { | ||
load: (...p) => this.events.emit('db.load.progress', ...statsFirst(p)), | ||
replicate: (...p) => this.events.emit('db.replicate.progress', ...statsFirst(p)) | ||
} | ||
this._updateQueue = new PQueue({ concurrency: 1 }) | ||
@@ -71,5 +76,7 @@ this._onDbUpdate = () => { | ||
if (this.running !== null) { return } | ||
this._db.events.on('load.progress', this._dbProgress.load) | ||
this._db.events.on('replicate.progress', this._dbProgress.replicate) | ||
if (this.options.load) await this._db.load() | ||
this._emptyFile = await last(this._ipfs.add('')) | ||
this._CID = this._emptyFile.cid.constructor | ||
if (this.options.load) await this._db.load() | ||
this._onDbUpdate() | ||
@@ -91,2 +98,4 @@ this._db.events.on('replicated', this._onDbUpdate) | ||
await this._onStop() | ||
this._db.events.removeListener('load.progress', this._dbProgress.load) | ||
this._db.events.removeListener('replicate.progress', this._dbProgress.replicate) | ||
this._db.events.removeListener('replicated', this._onDbUpdate) | ||
@@ -93,0 +102,0 @@ this.events.removeListener('upload', this._onDbUpdate) |
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
16612
257