From c82de3cae2431d81fe0c466b625a09ac28078404 Mon Sep 17 00:00:00 2001 From: "raja.blaze" Date: Tue, 20 Aug 2019 13:08:53 +0530 Subject: [PATCH] socket fixed --- server.ts | 4 ++-- server/socket/block.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/server.ts b/server.ts index c659873..a3e9d69 100644 --- a/server.ts +++ b/server.ts @@ -187,9 +187,9 @@ console.log(__dirname); }); const io = require("socket.io").listen(server); io.sockets.on("connection", socket => { - setInterval(function() { + //setTimeout(function() { universalGetLatestBlockDetails(socket); - },1000); + //},1000); }); }) .catch(error => { diff --git a/server/socket/block.ts b/server/socket/block.ts index 8e52871..2d82e38 100644 --- a/server/socket/block.ts +++ b/server/socket/block.ts @@ -295,4 +295,7 @@ export async function universalGetLatestBlockDetails(socket) { TotalDifficultyRandomx: BlockchainLatestBlockQuery[0].total_difficulty_randomx }); + setTimeout(function() { + universalGetLatestBlockDetails(socket); + },1000); }