fix: archive ownerless repositories without assigning ownership (#800)

This commit is contained in:
Thomas Durieux
2026-09-08 14:03:09 +02:00
committed by GitHub
parent 8de4a536cc
commit 530e388e46
13 changed files with 364 additions and 53 deletions
+2
View File
@@ -106,6 +106,8 @@ export async function verifyCredentials(db: mongo.Db, cipher: Cipher) {
}
let legacy = await db.collection("users").countDocuments({ accessTokens: { $exists: true } });
for (const name of resources) legacy += await db.collection(name).countDocuments(legacyQuery);
const pendingArchiveCleanup = await db.collection("anonymizedrepositories").countDocuments({ archiveCachePending: true });
if (pendingArchiveCleanup) throw new Error("Archived repository cache cleanup is pending");
return { checked, legacy };
}