Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(secret-value-tracking): index a batch one row at a time

Calvinad5f36514f72
diff --git a/backend/src/services/secret-value-tracking/secret-value-tracking-queue.ts b/backend/src/services/secret-value-tracking/secret-value-tracking-queue.ts
index ad890b41b9..376534d788 100644
--- a/backend/src/services/secret-value-tracking/secret-value-tracking-queue.ts
+++ b/backend/src/services/secret-value-tracking/secret-value-tracking-queue.ts
@@ -141,22 +141,23 @@ export const secretValueTrackingQueueFactory = ({
const pending = rows.filter(needsBackfill);
if (pending.length) {
+ // One row at a time: each digest runs on the libuv threadpool, and fanning out a whole
+ // batch at once would queue thousands of jobs ahead of the API's own crypto and DNS work.
+ const updates: Parameters<TSecretV2BridgeDALFactory["batchSetBlindIndexes"]>[0] = [];
// eslint-disable-next-line no-await-in-loop
- const updates = await Promise.all(
- pending.map(async (row) => {
- const value = decryptor({ cipherTextBlob: row.encryptedValue as Buffer });
- const [secretValueBlindIndex, secretValueOrgBlindIndex] = await Promise.all([
- generateSecretBlindIndex(value),
- generateOrgLevelBlindIndex(value)
- ]);
- return {
- id: row.id,
- encryptedValue: row.encryptedValue as Buffer,
- secretValueBlindIndex,
- secretValueOrgBlindIndex
- };
- })
- );
+ for await (const row of pending) {
+ const value = decryptor({ cipherTextBlob: row.encryptedValue as Buffer });
+ const [secretValueBlindIndex, secretValueOrgBlindIndex] = await Promise.all([
+ generateSecretBlindIndex(value),
+ generateOrgLevelBlindIndex(value)
+ ]);
+ updates.push({
+ id: row.id,
+ encryptedValue: row.encryptedValue as Buffer,
+ secretValueBlindIndex,
+ secretValueOrgBlindIndex
+ });
+ }
// eslint-disable-next-line no-await-in-loop
await secretV2BridgeDAL.batchSetBlindIndexes(updates);
progress.secretsProcessed += updates.length;
diff --git a/docs/documentation/platform/insights.mdx b/docs/documentation/platform/insights.mdx
index 2a9bd8469b..1a4607d16f 100644
--- a/docs/documentation/platform/insights.mdx
+++ b/docs/documentation/platform/insights.mdx
@@ -27,8 +27,6 @@ In your organization, go to **Secrets Management** > **Insights**.
To view the page, your organization role needs the **Read** permission under **Secrets Management Insights**. The built-in **Admin** role has it. To grant it to another role, see [organization role-based access controls](/documentation/platform/access-controls/role-based-access-controls#organization-level-access-controls).
-Organization insights are refreshed every 15 minutes, so a change can take up to 15 minutes to appear.
-
## Summary
The three cards at the top of the page count:
@@ -116,8 +114,6 @@ In a Secrets Management project, select **Insights** in the project sidebar.
To view the page, your project role needs the **Read** permission on **Insights**. To grant it, see [project role-based access controls](/documentation/platform/access-controls/role-based-access-controls#project-level-access-controls).
-Project insights are refreshed every 5 minutes, so a change can take up to 5 minutes to appear.
-
The page header counts the project's secrets, environments, folders, rotations, dynamic secrets, and honey tokens (honey tokens appear only if your plan includes them and you can read them).
## Summary