Fixed integrations & bulk update issue

This commit is contained in:
Daniel Hougaard
2024-02-22 05:00:40 +01:00
parent 10fbb99a15
commit aa81711824
2 changed files with 156 additions and 125 deletions
+4 -15
View File
@@ -178,6 +178,10 @@ export const projectQueueFactory = ({
approvalSecrets.push(...secretApprovals);
}
const projectIntegrationAuths = await integrationAuthDAL.find({
projectId: project.id
});
const decryptedSecrets = decryptSecrets(secrets, userPrivateKey, oldProjectKey);
const decryptedSecretVersions = decryptSecretVersions(secretVersions, userPrivateKey, oldProjectKey);
const decryptedApprovalSecrets = decryptSecretApprovals(approvalSecrets, userPrivateKey, oldProjectKey);
@@ -504,21 +508,6 @@ export const projectQueueFactory = ({
throw new Error("Parts of the upgrade failed. Some secrets were not updated");
}
const secretUpdates = await secretDAL.bulkUpdateNoVersionIncrement(updatedSecrets, tx);
const secretVersionUpdates = await secretVersionDAL.bulkUpdateNoVersionIncrement(updatedSecretVersions, tx);
const secretApprovalUpdates = await secretApprovalSecretDAL.bulkUpdateNoVersionIncrement(
updatedSecretApprovals,
tx
);
if (
secretUpdates.length !== updatedSecrets.length ||
secretVersionUpdates.length !== updatedSecretVersions.length ||
secretApprovalUpdates.length !== updatedSecretApprovals.length
) {
throw new Error("Parts of the upgrade failed. Some secrets were not updated");
}
await projectDAL.setProjectUpgradeStatus(data.projectId, null, tx);
// await new Promise((resolve) => setTimeout(resolve, 15_000));