tomap + stats

This commit is contained in:
Mark Nadal 2019-04-27 11:54:25 -07:00
parent 2071512b20
commit bf40e7e152
2 changed files with 3 additions and 2 deletions

3
gun.js
View File

@ -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){

View File

@ -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() || {};