delegate more work from getOlderHistory to the worker

This commit is contained in:
ansuz
2020-04-17 17:01:47 -04:00
parent fd169ff39c
commit b56c73be6e
3 changed files with 27 additions and 26 deletions

View File

@@ -250,12 +250,14 @@ Workers.initialize = function (Env, config, _cb) {
});
};
Env.getOlderHistory = function (channel, oldestKnownHash, cb) {
Env.getOlderHistory = function (channel, oldestKnownHash, desiredMessages, desiredCheckpoint, cb) {
Env.store.getWeakLock(channel, function (next) {
sendCommand({
channel: channel,
command: "GET_OLDER_HISTORY",
hash: oldestKnownHash,
desiredMessages: desiredMessages,
desiredCheckpoint: desiredCheckpoint,
}, Util.both(next, cb));
});
};