mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 06:39:02 +02:00
Merge pull request #25414 from overleaf/bg-history-only-log-content-mismatch-once-per-request
log warning for content hash mismatch only on first occurrence GitOrigin-RevId: ff09f8c262461488bd564ea0644d414bb32ff17e
This commit is contained in:
@@ -167,10 +167,13 @@ async function persistChanges(projectId, allChanges, limits, clientEndVersion) {
|
||||
const actualHash = content != null ? getContentHash(content) : null
|
||||
logger.debug({ expectedHash, actualHash }, 'validating content hash')
|
||||
if (actualHash !== expectedHash) {
|
||||
logger.warn(
|
||||
{ projectId, path, expectedHash, actualHash },
|
||||
'content hash mismatch'
|
||||
)
|
||||
// only log a warning on the first mismatch in each persistChanges call
|
||||
if (!resyncNeeded) {
|
||||
logger.warn(
|
||||
{ projectId, path, expectedHash, actualHash },
|
||||
'content hash mismatch'
|
||||
)
|
||||
}
|
||||
resyncNeeded = true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user