mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
tomap + stats
This commit is contained in:
parent
2071512b20
commit
bf40e7e152
3
gun.js
3
gun.js
@ -1985,7 +1985,7 @@
|
||||
}
|
||||
(msg._ = function(){}).via = peer;
|
||||
if((tmp = msg['><'])){
|
||||
(msg._).to = Type.obj.map(tmp.split(','), function(k,i,m){m(k,true)});
|
||||
(msg._).to = Type.obj.map(tmp.split(','), tomap);
|
||||
}
|
||||
if(msg.dam){
|
||||
if(tmp = mesh.hear[msg.dam]){
|
||||
@ -2008,6 +2008,7 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
var tomap = function(k,i,m){m(k,true)};
|
||||
|
||||
;(function(){
|
||||
mesh.say = function(msg, peer, o){
|
||||
|
@ -25,7 +25,7 @@ Gun.on('opt', function(root){
|
||||
root.stats.up.count = (root.stats.up.count || 0) + 1;
|
||||
},1);
|
||||
setInterval(function(){
|
||||
if(!root.stats){ return }
|
||||
if(!root.stats){ root.stats = {} }
|
||||
var stats = root.stats, tmp;
|
||||
(stats.up||{}).time = process.uptime();
|
||||
stats.memory = process.memoryUsage() || {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user