diff --git a/examples/package.json b/examples/package.json index 72449c6e..72a828f2 100644 --- a/examples/package.json +++ b/examples/package.json @@ -4,7 +4,7 @@ "description": "Example gun apps" , "version": "0.0.1" , "engines": { - "node": "~>0.8.x" + "node": "~>0.10.x" } , "dependencies": { "express": "~>4.9.0", diff --git a/lib/wsp.js b/lib/wsp.js index c29c73e3..0637904d 100644 --- a/lib/wsp.js +++ b/lib/wsp.js @@ -129,6 +129,7 @@ reply.loaded = true; })); // could there be a timing error somewhere in here? + var setImmediate = setImmediate || setTimeout; // TODO: BUG: This should be cleaned up, but I want Heroku to work. setImmediate(function(){ // do not do it right away because gun.load above is async, this should be cleaner. var context = gun.union(req.body, function check(err, ctx){ // check if the body is valid, and get it into cache immediately. context = ctx || context; @@ -140,7 +141,7 @@ cb({headers: reply.headers, body: {ok: "Persisted."}}); }); }); - }); + }, 0); gun.server.on('network').emit(req); } tran.post.key = function(req, cb){ // key hook!