From 8e2c9ebfa325d529327eded45da09152623f4fd9 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 29 Jan 2018 14:26:24 +0100 Subject: [PATCH] lint compliance or something --- rpc.js | 18 +++++++++++------- storage/tasks.js | 2 +- www/common/outer/async-store.js | 1 - 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/rpc.js b/rpc.js index dad806a5b..83d166e2e 100644 --- a/rpc.js +++ b/rpc.js @@ -369,15 +369,19 @@ var getDeletedPads = function (Env, channels, cb) { var sem = Saferphore.create(10); var absentees = []; + + var job = function (channel, wait) { + return function (give) { + getFileSize(Env, channel, wait(give(function (e, size) { + if (e) { return; } + if (size === 0) { absentees.push(channel); } + }))); + }; + }; + nThen(function (w) { for (var i = 0; i < L; i++) { - let channel = channels[i]; - sem.take(function (give) { - getFileSize(Env, channel, w(give(function (e, size) { - if (e) { return; } - if (size === 0) { absentees.push(channel); } - }))); - }); + sem.take(job(channels[i], w)); } }).nThen(function () { cb(void 0, absentees); diff --git a/storage/tasks.js b/storage/tasks.js index b25a3a637..85df70a8d 100644 --- a/storage/tasks.js +++ b/storage/tasks.js @@ -63,7 +63,7 @@ var write = function (env, task, cb) { return void cb(err); } })); - }).nThen(function (w) { + }).nThen(function () { // write the file to the path Fs.writeFile(mkPath(env, id), str, function (e) { if (e) { return void cb(e); } diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index bf8879d6f..7198c819f 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -335,7 +335,6 @@ define([ } store.anon_rpc.send('GET_DELETED_PADS', list, function (e, res) { - console.log(e, res); if (e) { return void cb({error: e}); } if (res && res.length && Array.isArray(res[0])) { cb(res[0]);