Merge branch 'scaling-index' into soon

This commit is contained in:
ansuz
2020-03-20 18:57:51 -04:00
4 changed files with 280 additions and 117 deletions

View File

@@ -1027,16 +1027,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
@@ -1081,6 +1082,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) {