fix(regions): speed up inserts

This commit is contained in:
Chuck Driesler
2025-02-06 16:59:44 +00:00
parent b48721e85a
commit 04edd9c6af
6 changed files with 124 additions and 100 deletions
@@ -70,9 +70,12 @@ export const updateProjectRegionFactory =
const sourceProjectModelCount = await deps.countProjectModels(projectId)
const sourceProjectVersionCount = await deps.countProjectVersions(projectId)
const isReconciled =
modelIds[projectId].length === sourceProjectModelCount &&
versionIds[projectId].length === sourceProjectVersionCount
const tests = [
modelIds[projectId] === sourceProjectModelCount,
versionIds[projectId] === sourceProjectVersionCount
]
const isReconciled = tests.every((test) => !!test)
if (!isReconciled) {
// TODO: Move failed or source project added data while changing regions. Retry move.