diff --git a/services/history-v1/storage/lib/commit_changes.js b/services/history-v1/storage/lib/commit_changes.js index 5b85a13087..5749e5fc0e 100644 --- a/services/history-v1/storage/lib/commit_changes.js +++ b/services/history-v1/storage/lib/commit_changes.js @@ -65,10 +65,10 @@ async function commitChanges( await queueChanges(projectId, changes, endVersion) return await persistBuffer(projectId, limits) case 2: // Equivalent to queueChangesInRedis:true - await queueChangesFake(projectId, changes, limits, endVersion) + await queueChangesFake(projectId, changes, endVersion) return await persistChanges(projectId, changes, limits, endVersion) case 1: // Queue changes with fake persist only for projects in redis already - await queueChangesFakeOnlyIfExists(projectId, changes, limits, endVersion) + await queueChangesFakeOnlyIfExists(projectId, changes, endVersion) return await persistChanges(projectId, changes, limits, endVersion) case 0: // Persist changes directly to the chunk store return await persistChanges(projectId, changes, limits, endVersion) @@ -81,20 +81,13 @@ async function commitChanges( * Queues a set of changes in redis as if they had been persisted, ignoring any errors. * @param {string} projectId * @param {Change[]} changes - * @param {Object} limits * @param {number} endVersion * @param {Object} [options] * @param {boolean} [options.onlyIfExists] - If true, only queue changes if the project * already exists in Redis. */ -async function queueChangesFake( - projectId, - changes, - limits, - endVersion, - options = {} -) { +async function queueChangesFake(projectId, changes, endVersion, options = {}) { try { await queueChanges(projectId, changes, endVersion) await fakePersistRedisChanges(projectId, changes, endVersion) @@ -107,17 +100,11 @@ async function queueChangesFake( * Queues changes in Redis, simulating persistence, but only if the project already exists. * @param {string} projectId - The ID of the project. * @param {Change[]} changes - An array of changes to be queued. - * @param {Object} limits - Limits for the changes. * @param {number} endVersion - The expected version of the project before these changes are applied. */ -async function queueChangesFakeOnlyIfExists( - projectId, - changes, - limits, - endVersion -) { - await queueChangesFake(projectId, changes, limits, endVersion, { +async function queueChangesFakeOnlyIfExists(projectId, changes, endVersion) { + await queueChangesFake(projectId, changes, endVersion, { onlyIfExists: true, }) }