@nxtedition/rocksdb 7.1.8 → 7.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +4 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -115,7 +115,7 @@ class RocksLevel extends AbstractLevel {
115
115
  [kUnref] () {
116
116
  this[kRefs]--
117
117
  if (this[kRefs] === 0 && this[kPendingClose]) {
118
- this[kPendingClose]()
118
+ process.nextTick(this[kPendingClose])
119
119
  }
120
120
  }
121
121
 
@@ -205,7 +205,10 @@ class RocksLevel extends AbstractLevel {
205
205
  try {
206
206
  const seq = this.sequence
207
207
  let sync = true
208
+ this[kRef]()
208
209
  binding.batch_write(this[kContext], context, options, (err) => {
210
+ this[kUnref]()
211
+
209
212
  if (!err) {
210
213
  this.emit('update', {
211
214
  rows: batch.toArray(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "7.1.8",
3
+ "version": "7.1.9",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",