mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
0.16.0-beta.7
Prevent double writes to cache Update build
This commit is contained in:
parent
c79a1a125f
commit
ae9ad807c3
2
dist/orbitdb.js
vendored
2
dist/orbitdb.js
vendored
@ -4636,6 +4636,8 @@ var Cache = function () {
|
|||||||
key: 'set',
|
key: 'set',
|
||||||
value: function set(key, value) {
|
value: function set(key, value) {
|
||||||
return new _promise2.default(function (resolve, reject) {
|
return new _promise2.default(function (resolve, reject) {
|
||||||
|
if (cache[key] === value) return resolve();
|
||||||
|
|
||||||
cache[key] = value;
|
cache[key] = value;
|
||||||
if (filePath && store) {
|
if (filePath && store) {
|
||||||
lock(filePath, function (release) {
|
lock(filePath, function (release) {
|
||||||
|
2
dist/orbitdb.min.js
vendored
2
dist/orbitdb.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "orbit-db",
|
"name": "orbit-db",
|
||||||
"version": "0.16.0-beta.6",
|
"version": "0.16.0-beta.7",
|
||||||
"description": "Distributed p2p database on IPFS",
|
"description": "Distributed p2p database on IPFS",
|
||||||
"author": "Haad",
|
"author": "Haad",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -12,6 +12,9 @@ const lock = new Lock()
|
|||||||
class Cache {
|
class Cache {
|
||||||
static set(key, value) {
|
static set(key, value) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
if (cache[key] === value)
|
||||||
|
return resolve()
|
||||||
|
|
||||||
cache[key] = value
|
cache[key] = value
|
||||||
if(filePath && store) {
|
if(filePath && store) {
|
||||||
lock(filePath, (release) => {
|
lock(filePath, (release) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user