Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
commit
1fd4f43c7c
18
rpc.js
18
rpc.js
@ -369,15 +369,19 @@ var getDeletedPads = function (Env, channels, cb) {
|
|||||||
|
|
||||||
var sem = Saferphore.create(10);
|
var sem = Saferphore.create(10);
|
||||||
var absentees = [];
|
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) {
|
nThen(function (w) {
|
||||||
for (var i = 0; i < L; i++) {
|
for (var i = 0; i < L; i++) {
|
||||||
let channel = channels[i];
|
sem.take(job(channels[i], w));
|
||||||
sem.take(function (give) {
|
|
||||||
getFileSize(Env, channel, w(give(function (e, size) {
|
|
||||||
if (e) { return; }
|
|
||||||
if (size === 0) { absentees.push(channel); }
|
|
||||||
})));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).nThen(function () {
|
}).nThen(function () {
|
||||||
cb(void 0, absentees);
|
cb(void 0, absentees);
|
||||||
|
|||||||
@ -63,7 +63,7 @@ var write = function (env, task, cb) {
|
|||||||
return void cb(err);
|
return void cb(err);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}).nThen(function (w) {
|
}).nThen(function () {
|
||||||
// write the file to the path
|
// write the file to the path
|
||||||
Fs.writeFile(mkPath(env, id), str, function (e) {
|
Fs.writeFile(mkPath(env, id), str, function (e) {
|
||||||
if (e) { return void cb(e); }
|
if (e) { return void cb(e); }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user