Le mirroring des dépôts vers Github est maintenant natif dans Gitlab (et donc Framagit). Merci de passer à la fonction native pour que nous puissions couper notre solution maison. Détails sur https://docs.gitlab.com/ee/workflow/repository_mirroring.html#pushing-to-a-remote-repository (pensez à supprimer le webhook de notre solution maison).

Commit 985b4456 by Luc Didry

Make startup emptyness test unparallel

parent 9e178c62
......@@ -36,24 +36,34 @@ exports.deletePadsAtStart = function (hook_name, args, cb) {
var q = async.queue(function (pad, callback) {
pad.remove(callback);
}, 2);
// Emptyness test queue
var p = async.queue(function(padId, callback) {
PadManager.getPad(padId, function (err, pad) {
if (err) {
return callback(err);
}
var head = pad.getHeadRevisionNumber();
if (head !== undefined && head !== null) {
if (head === 0) {
q.push(pad, function (err) {
if (err) {
return callback(err);
}
console.log('Deleting %s at startup since empty', pad.id);
});
}
callback();
}
});
}, 1);
PadManager.listAllPads(function (err, data) {
async.each(data.padIDs, function (padId, cb) {
PadManager.getPad(padId, function (err, pad) {
for (var i = 0; i < data.padIDs.length; i++) {
var padId = data.padIDs[i];
p.push(padId, function(err) {
if (err) {
return cb(err);
}
var head = pad.getHeadRevisionNumber();
if (head !== undefined && head !== null) {
if (head === 0) {
q.push(pad, function (err) {
if (err) {
return cb(err);
}
console.log('Deleting %s at startup since empty', pad.id);
});
}
}
});
});
}
});
};
{
"name": "ep_delete_empty_pads",
"version": "0.0.4",
"version": "0.0.5",
"description": "Delete pads which were never edited",
"author": {
"name": "Luc Didry",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment