From 3fbd4aef736e15cb223365dbac6e7051b6c60875 Mon Sep 17 00:00:00 2001 From: zeus Date: Sun, 29 Nov 2020 17:50:46 +0200 Subject: [PATCH] prox --- swarmlab-app/src/run/app.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 5ca235a..0c09f45 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -431,20 +431,23 @@ function getSHA256ofJSON(input){ return require("crypto").createHash("sha256").update(JSON.stringify(input)).digest("hex"); } -var getkey = function getkey(key) { - return new Promise((resolve) => { +//var getkey = function getkey(key) { +async function getkey(key) { + //return new Promise((resolve) => { - pubClient.get(key, function (err, reply) { + await pubClient.get(key, function (err, reply) { if(err){ console.log('----------not fount------------') - resolve(null) + //resolve(null) + return null } else { console.log('---------fount----------') - resolve(reply) + //resolve(reply) + return reply } }) - }) + //}) } var setkey = function setkv(key,value){