From 88dea32deb01e1887b90ecf24699f5ab6c7ee077 Mon Sep 17 00:00:00 2001 From: zeus Date: Sat, 28 Nov 2020 15:55:51 +0200 Subject: [PATCH] async --- swarmlab-app/src/run/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 9e4f6cf..c1f3779 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -503,14 +503,16 @@ function onCollection(err, collection) { console.log('<<<<<<<<<<<---------------------<<<<<<<<<<<<<<<---------------------------<<<<<<<<<<<< '+JSON.stringify(object)); console.log('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< '+JSON.stringify(reslog)); var user = objecttmp.user25user - await pubClient.get(issend, function(err, object) { + (async() => { + await pubClient.get(issend, function(err, object) { if(err == null){ pubClient.set(issend, itemsProcessed, function(err, res) { io.in(user).emit("logdata", reslog); }); } itemsProcessed++; - }); + }); + })() //await }); })() //await inside no }