Skip to content

Commit

Permalink
urgent fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
amark committed Aug 2, 2017
1 parent 9ce98ff commit 4020ca2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion gun.js
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@
as.ref.get('_').get(any, {as: as});
if(!as.out){
// TODO: Perf idea! Make a global lock, that blocks everything while it is on, but if it is on the lock it does the expensive lookup to see if it is a dependent write or not and if not then it proceeds full speed. Meh? For write heavy async apps that would be terrible.
as.res = as.res || noop; // Gun.on.stun(as.ref); // TODO: BUG! Deal with locking?
as.res = as.res || stun; // Gun.on.stun(as.ref); // TODO: BUG! Deal with locking?
as.gun._.stun = as.ref._.stun;
}
return gun;
Expand All @@ -1299,6 +1299,22 @@
as.batch();
}

function stun(cb){
if(cb){ cb() }
return;
var as = this;
if(!as.ref){ return }
if(cb){
as.after = as.ref._.tag;
as.now = as.ref._.tag = {};
cb();
return;
}
if(as.after){
as.ref._.tag = as.after;
}
}

function batch(){ var as = this;
if(!as.graph || obj_map(as.stun, no)){ return }
(as.res||iife)(function(){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gun",
"version": "0.8.1",
"version": "0.8.2",
"description": "Graph engine",
"main": "index.js",
"browser": "gun.min.js",
Expand Down

0 comments on commit 4020ca2

Please sign in to comment.