simplify logAppend

This commit is contained in:
Andre Staltz 2023-04-09 10:48:28 +03:00
parent edfabd8d14
commit 79ebb033fe
1 changed files with 3 additions and 3 deletions

View File

@ -137,7 +137,7 @@ exports.init = function initDB(peer, config) {
) )
}) })
function logAppend(id, msg, feedId, isOOO, cb) { function logAppend(id, msg, cb) {
const rec = { const rec = {
id, id,
msg, msg,
@ -191,7 +191,7 @@ exports.init = function initDB(peer, config) {
const msgId = FeedV1.getMsgId(msg) const msgId = FeedV1.getMsgId(msg)
msgsPerFeed.update(msg, msgId) msgsPerFeed.update(msg, msgId)
logAppend(msgId, msg, feedId, false, logAppendCB) logAppend(msgId, msg, logAppendCB)
} }
function logAppendCB(err, rec) { function logAppendCB(err, rec) {
@ -261,7 +261,7 @@ exports.init = function initDB(peer, config) {
msgsPerFeed.update(msg, msgId) msgsPerFeed.update(msg, msgId)
// Encode the native message and append it to the log: // Encode the native message and append it to the log:
logAppend(msgId, msg, feedId, false, (err, rec) => { logAppend(msgId, msg, (err, rec) => {
// prettier-ignore // prettier-ignore
if (err) return cb(new Error('create() failed to append the log', { cause: err })) if (err) return cb(new Error('create() failed to append the log', { cause: err }))
onRecordAdded.set(rec) onRecordAdded.set(rec)