mirror of
https://github.com/amark/gun.git
synced 2026-03-21 15:49:25 +00:00
make sure to call next middleware
This commit is contained in:
@@ -64,7 +64,7 @@ Gun.on('opt', function(root){
|
||||
// if we DO need an HTTP server, then choose ws specific one or GUN default one.
|
||||
if(!ws.noServer){
|
||||
ws.server = ws.server || opt.web;
|
||||
if(!ws.server){ return }
|
||||
if(!ws.server){ this.to.next(root); return } // ugh, bug fix for @jamierez & unstoppable ryan.
|
||||
}
|
||||
ws.web = ws.web || new opt.WebSocket.Server(ws); // we still need a WS server.
|
||||
ws.web.on('connection', function(wire){ var peer;
|
||||
@@ -80,6 +80,5 @@ Gun.on('opt', function(root){
|
||||
wire.on('error', function(e){});
|
||||
setTimeout(function heart(){ if(!opt.peers[peer.id]){ return } try{ wire.send("[]") }catch(e){} ;setTimeout(heart, 1000 * 20) }, 1000 * 20); // Some systems, like Heroku, require heartbeats to not time out. // TODO: Make this configurable? // TODO: PERF: Find better approach than try/timeouts?
|
||||
});
|
||||
|
||||
this.to.next(root);
|
||||
});
|
||||
Reference in New Issue
Block a user