Skip to content

Commit cb1efeb

Browse files
committed
improvement(credentials): parallelize independent ref-clearing scans
1 parent 249286d commit cb1efeb

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

apps/sim/lib/credentials/deletion.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,13 @@ export async function clearCredentialRefs(
8484
): Promise<void> {
8585
const needle = `%${credentialId}%`
8686

87-
await clearInWorkflowBlocks(credentialId, workspaceId, needle)
88-
await clearInDeploymentVersions(credentialId, workspaceId, needle)
89-
await clearInPausedExecutions(credentialId, workspaceId, needle)
90-
await clearInWorkflowCheckpoints(credentialId, workspaceId, needle)
91-
await clearInKnowledgeConnectors(credentialId)
87+
await Promise.all([
88+
clearInWorkflowBlocks(credentialId, workspaceId, needle),
89+
clearInDeploymentVersions(credentialId, workspaceId, needle),
90+
clearInPausedExecutions(credentialId, workspaceId, needle),
91+
clearInWorkflowCheckpoints(credentialId, workspaceId, needle),
92+
clearInKnowledgeConnectors(credentialId),
93+
])
9294
}
9395

9496
async function clearInWorkflowBlocks(

0 commit comments

Comments
 (0)