Comparing version 2.9.2 to 2.9.3-beta.1
@@ -26,3 +26,3 @@ import { WeakLRUCache, clearKeptObjects } from './native.js'; | ||
let entry = mapGet.call(cache, meta.key); | ||
if (entry) { | ||
if (entry && !entry.txnId) { | ||
entry.txnId = txnId; | ||
@@ -131,15 +131,19 @@ cache.used(entry, expirationPriority + 4); // this will enter it into the LRFU (with a little lower priority than a read) | ||
let entry; | ||
if (result?.isSync) { | ||
// sync operation, immediately add to cache | ||
if (result.result) // if it succeeds | ||
entry = this.cache.setValue(id, value, 0); | ||
else { | ||
this.cache.delete(id); | ||
return result; | ||
} // sync failure | ||
// otherwise keep it pinned in memory until it is committed | ||
} else entry = this.cache.setValue(id, value, -1); | ||
if (this.cachePuts === false) { // we are not caching puts, clear the entry at least | ||
this.cache.delete(id); | ||
} else { | ||
if (result?.isSync) { | ||
// sync operation, immediately add to cache | ||
if (result.result) // if it succeeds | ||
entry = this.cache.setValue(id, value, 0); | ||
else { | ||
this.cache.delete(id); | ||
return result; | ||
} // sync failure | ||
// otherwise keep it pinned in memory until it is committed | ||
} else entry = this.cache.setValue(id, value, -1); | ||
} | ||
if (childTxnChanges) | ||
childTxnChanges.add(id); | ||
if (version !== undefined) | ||
if (version !== undefined && entry) | ||
entry.version = typeof version === 'object' ? version.version : version; | ||
@@ -153,3 +157,3 @@ } | ||
// sync operation, immediately add to cache, otherwise keep it pinned in memory until it is committed | ||
if (value && typeof value === 'object' || !result) { | ||
if (value && this.cachePuts !== false && typeof value === 'object' && result) { | ||
let entry = this.cache.setValue(id, value); | ||
@@ -156,0 +160,0 @@ if (childTxnChanges) |
{ | ||
"name": "lmdb", | ||
"author": "Kris Zyp", | ||
"version": "2.9.2", | ||
"version": "2.9.3-beta.1", | ||
"description": "Simple, efficient, scalable, high-performance LMDB interface", | ||
@@ -71,3 +71,3 @@ "license": "MIT", | ||
"prebuildify": "prebuildify-platform-packages --napi --target 18.17.1", | ||
"full-publish": "cd prebuilds/win32-x64 && npm publish --access public && cd ../darwin-x64 && npm publish --access public && cd ../darwin-arm64 && npm publish --access public && cd ../linux-x64 && npm publish --access public && cd ../linux-arm64 && npm publish --access public && cd ../linux-arm && npm publish --access public && cd ../.. && npm publish", | ||
"full-publish": "cd prebuilds/win32-x64 && npm publish --tag next --access public && cd ../darwin-x64 && npm publish --tag next --access public && cd ../darwin-arm64 && npm publish --tag next --access public && cd ../linux-x64 && npm publish --tag next --access public && cd ../linux-arm64 && npm publish --tag next --access public && cd ../linux-arm && npm publish --tag next --access public && cd ../.. && npm publish --tag next", | ||
"recompile": "node-gyp clean && node-gyp configure && node-gyp build", | ||
@@ -114,9 +114,9 @@ "test": "mocha test/**.test.js --expose-gc --recursive", | ||
"optionalDependencies": { | ||
"@lmdb/lmdb-darwin-arm64": "2.9.2", | ||
"@lmdb/lmdb-darwin-x64": "2.9.2", | ||
"@lmdb/lmdb-linux-arm": "2.9.2", | ||
"@lmdb/lmdb-linux-arm64": "2.9.2", | ||
"@lmdb/lmdb-linux-x64": "2.9.2", | ||
"@lmdb/lmdb-win32-x64": "2.9.2" | ||
"@lmdb/lmdb-darwin-arm64": "2.9.3-beta.1", | ||
"@lmdb/lmdb-darwin-x64": "2.9.3-beta.1", | ||
"@lmdb/lmdb-linux-arm": "2.9.3-beta.1", | ||
"@lmdb/lmdb-linux-arm64": "2.9.3-beta.1", | ||
"@lmdb/lmdb-linux-x64": "2.9.3-beta.1", | ||
"@lmdb/lmdb-win32-x64": "2.9.3-beta.1" | ||
} | ||
} |
@@ -34,3 +34,5 @@ export const SKIP = {}; | ||
if (iteratorResult.then) { | ||
if (!async) throw new Error('Can not synchronously iterate with asynchronous values'); | ||
if (!async) { | ||
throw new Error('Can not synchronously iterate with asynchronous values'); | ||
} | ||
return iteratorResult.then(iteratorResult => this.next(iteratorResult), onError); | ||
@@ -37,0 +39,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
2441285
6472
1