mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 05:41:33 +02:00
Merge pull request #8644 from overleaf/bg-archive-track-changes
archive track changes zip files in project when history migration fails GitOrigin-RevId: 67f2381b0a8f2fb1de82100752031c65808af885
This commit is contained in:
@@ -125,6 +125,27 @@ const ProjectHistoryHandler = {
|
||||
)
|
||||
},
|
||||
|
||||
setMigrationArchiveFlag(project_id, callback) {
|
||||
if (callback == null) {
|
||||
callback = function () {}
|
||||
}
|
||||
Project.updateOne(
|
||||
{ _id: project_id, version: { $exists: true } },
|
||||
{
|
||||
'overleaf.history.zipFileArchivedInProject': true,
|
||||
},
|
||||
function (err, result) {
|
||||
if (err != null) {
|
||||
return callback(err)
|
||||
}
|
||||
if ((result != null ? result.n : undefined) === 0) {
|
||||
return callback(new Error('migration flag not set'))
|
||||
}
|
||||
return callback()
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
ensureHistoryExistsForProject(project_id, callback) {
|
||||
// We can only set a history id for a project that doesn't have one. The
|
||||
// history id is cached in the project history service, and changing an
|
||||
|
||||
Reference in New Issue
Block a user