[document-updater] add flag for checking sync state of a single project (#26433)

GitOrigin-RevId: 504f607c652e59fa1305067f273db849d7923da2
This commit is contained in:
Jakob Ackermann
2025-06-13 16:02:24 +02:00
committed by Copybot
parent 8b937c91f4
commit c7dd7208fb

View File

@@ -15,6 +15,7 @@ const request = require('requestretry').defaults({
retryDelay: 10,
})
const ONLY_PROJECT_ID = process.env.ONLY_PROJECT_ID
const AUTO_FIX_VERSION_MISMATCH =
process.env.AUTO_FIX_VERSION_MISMATCH === 'true'
const AUTO_FIX_PARTIALLY_DELETED_DOC_METADATA =
@@ -319,10 +320,12 @@ async function processProject(projectId) {
* @return {Promise<{perIterationOutOfSync: number, done: boolean}>}
*/
async function scanOnce(processed, outOfSync) {
const projectIds = await ProjectFlusher.promises.flushAllProjects({
limit: LIMIT,
dryRun: true,
})
const projectIds = ONLY_PROJECT_ID
? [ONLY_PROJECT_ID]
: await ProjectFlusher.promises.flushAllProjects({
limit: LIMIT,
dryRun: true,
})
let perIterationOutOfSync = 0
for (const projectId of projectIds) {