Browse Source

use JSON for heartbeat tick

Nikolay Suslov 4 years ago
parent
commit
6e719b31d9
1 changed files with 4 additions and 3 deletions
  1. 4 3
      index.js

+ 4 - 3
index.js

@@ -38,11 +38,12 @@ global.gun.get('server').get('heartbeat').get('tick').put(JSON.stringify(tickMsg
 setInterval(function () {
 
     let message = {
-        parameters: [],
-        time: 'tick'//hb
+        parameters: "[]",
+        time: 'tick', //hb
+        sender: 'server'
     };
 
-    global.gun.get('server').get('heartbeat').get('tick').put(JSON.stringify(message),function(ack){
+    global.gun.get('server').get('heartbeat').get('tick').put(message,function(ack){
         if(ack.err){ 
             console.log('ERROR: ' + ack.err)
         }});