|
|
@ -369,15 +369,19 @@ var getDeletedPads = function (Env, channels, cb) {
|
|
|
|
|
|
|
|
|
|
|
|
var sem = Saferphore.create(10);
|
|
|
|
var sem = Saferphore.create(10);
|
|
|
|
var absentees = [];
|
|
|
|
var absentees = [];
|
|
|
|
nThen(function (w) {
|
|
|
|
|
|
|
|
for (var i = 0; i < L; i++) {
|
|
|
|
var job = function (channel, wait) {
|
|
|
|
let channel = channels[i];
|
|
|
|
return function (give) {
|
|
|
|
sem.take(function (give) {
|
|
|
|
getFileSize(Env, channel, wait(give(function (e, size) {
|
|
|
|
getFileSize(Env, channel, w(give(function (e, size) {
|
|
|
|
|
|
|
|
if (e) { return; }
|
|
|
|
if (e) { return; }
|
|
|
|
if (size === 0) { absentees.push(channel); }
|
|
|
|
if (size === 0) { absentees.push(channel); }
|
|
|
|
})));
|
|
|
|
})));
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nThen(function (w) {
|
|
|
|
|
|
|
|
for (var i = 0; i < L; i++) {
|
|
|
|
|
|
|
|
sem.take(job(channels[i], w));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).nThen(function () {
|
|
|
|
}).nThen(function () {
|
|
|
|
cb(void 0, absentees);
|
|
|
|
cb(void 0, absentees);
|
|
|
|