mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 08:03:42 -05:00
Merge pull request #11096 from overleaf/bg-clear-first-op-timestamp-when-removing-updates
clear first op timestamp when removing updates GitOrigin-RevId: d561cf94df158457e58b14823e4572baac56e6d3
This commit is contained in:
parent
d1c2c46224
commit
3faff3388d
2 changed files with 9 additions and 6 deletions
|
@ -72,6 +72,10 @@ export function startHardResync(projectId, options, callback) {
|
||||||
keys.projectHistoryLock({ project_id: projectId }),
|
keys.projectHistoryLock({ project_id: projectId }),
|
||||||
(extendLock, releaseLock) =>
|
(extendLock, releaseLock) =>
|
||||||
clearResyncState(projectId, function (err) {
|
clearResyncState(projectId, function (err) {
|
||||||
|
if (err) {
|
||||||
|
return releaseLock(OError.tag(err))
|
||||||
|
}
|
||||||
|
RedisManager.clearFirstOpTimestamp(projectId, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return releaseLock(OError.tag(err))
|
return releaseLock(OError.tag(err))
|
||||||
}
|
}
|
||||||
|
@ -81,6 +85,7 @@ export function startHardResync(projectId, options, callback) {
|
||||||
}
|
}
|
||||||
_startResyncWithoutLock(projectId, options, releaseLock)
|
_startResyncWithoutLock(projectId, options, releaseLock)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}),
|
}),
|
||||||
function (error) {
|
function (error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|
|
@ -82,10 +82,8 @@ export function processUpdatesForProject(projectId, callback) {
|
||||||
OError.tag(error)
|
OError.tag(error)
|
||||||
}
|
}
|
||||||
ErrorRecorder.record(projectId, queueSize, error, callback)
|
ErrorRecorder.record(projectId, queueSize, error, callback)
|
||||||
if (error == null) {
|
// clear the timestamp in the background if the queue is now empty
|
||||||
// clear the flush marker in the background if the queue was fully cleared
|
RedisManager.clearDanglingFirstOpTimestamp(projectId, () => {})
|
||||||
RedisManager.clearFirstOpTimestamp(projectId)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue