WIP history-keeper fixes
This commit is contained in:
@@ -153,7 +153,8 @@ const computeIndex = function (data, cb) {
|
||||
messageBuf = [];
|
||||
}
|
||||
} else if (messageBuf.length > 100 && cpIndex.length === 0) {
|
||||
messageBuf = messageBuf.slice(0, 50);
|
||||
// take the last 50 messages
|
||||
messageBuf = messageBuf.slice(-50);
|
||||
}
|
||||
// if it's not metadata or a checkpoint then it should be a regular message
|
||||
// store it in the buffer
|
||||
@@ -352,7 +353,8 @@ const getMultipleFileSize = function (data, cb) {
|
||||
|
||||
const getHashOffset = function (data, cb) {
|
||||
const channelName = data.channel;
|
||||
const lastKnownHash = data.lastKnownHash;
|
||||
const lastKnownHash = data.hash;
|
||||
if (typeof(lastKnownHash) !== 'string') { return void cb("INVALID_HASH"); }
|
||||
|
||||
var offset = -1;
|
||||
store.readMessagesBin(channelName, 0, (msgObj, readMore, abort) => {
|
||||
|
||||
Reference in New Issue
Block a user