compute indexes in child processes

This commit is contained in:
ansuz
2020-03-19 10:46:18 -04:00
parent d1b16af160
commit 4522ffa18a
4 changed files with 280 additions and 117 deletions

View File

@@ -1024,16 +1024,17 @@ module.exports.create = function (conf, cb) {
// make sure the store's directory exists
Fse.mkdirp(env.root, PERMISSIVE, w(function (err) {
if (err && err.code !== 'EEXIST') {
throw err;
throw err; // XXX
}
}));
// make sure the cold storage directory exists
Fse.mkdirp(env.archiveRoot, PERMISSIVE, w(function (err) {
if (err && err.code !== 'EEXIST') {
throw err;
throw err; // XXX
}
}));
}).nThen(function () {
// XXX leave a place for an error
cb({
// OLDER METHODS
// write a new message to a log
@@ -1078,6 +1079,12 @@ module.exports.create = function (conf, cb) {
});
},
getWeakLock: function (channelName, _cb) {
var cb = Util.once(Util.mkAsync(_cb));
if (!isValidChannelId(channelName)) { return void cb(new Error('EINVAL')); }
schedule.unordered(channelName, cb);
},
// METHODS for deleting data
// remove a channel and its associated metadata log if present
removeChannel: function (channelName, cb) {