Update inactive project deactivation index (#24444)

* Update inactive project deactivation index

* Delete index first, otherwise Mongo complains that the index already exists with a different name

GitOrigin-RevId: b28a60c0774a77363c4e052ddb64bf68665cccf5
This commit is contained in:
Tim Down
2025-03-26 10:51:32 +00:00
committed by Copybot
parent dda94cdfbc
commit d04cc1d8ac
2 changed files with 43 additions and 3 deletions
@@ -5,7 +5,6 @@ const DocumentUpdaterHandler = require('../DocumentUpdater/DocumentUpdaterHandle
const ProjectGetter = require('../Project/ProjectGetter')
const ProjectUpdateHandler = require('../Project/ProjectUpdateHandler')
const { Project } = require('../../models/Project')
const { ObjectId } = require('mongodb-legacy')
const Modules = require('../../infrastructure/Modules')
const { READ_PREFERENCE_SECONDARY } = require('../../infrastructure/mongodb')
const { callbackifyAll } = require('@overleaf/promise-utils')
@@ -62,8 +61,6 @@ const InactiveProjectManager = {
projects = await Project.find({
lastOpened: { $not: { $gt: oldProjectDate } },
})
.where('_id')
.lt(ObjectId.createFromTime(oldProjectDate / 1000))
.where('active')
.equals(true)
.select('_id')