mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 18:26:04 +00:00
Merge pull request #2586 from Infisical/daniel/envkey-fix
fix: envkey migration failing due to not using batches
This commit is contained in:
@@ -214,9 +214,11 @@ export const importDataIntoInfisicalFn = async ({
|
|||||||
name: "Create secret"
|
name: "Create secret"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const secretBatches = chunkArray(secrets, 2500);
|
||||||
|
for await (const secretBatch of secretBatches) {
|
||||||
const secretsByKeys = await secretDAL.findBySecretKeys(
|
const secretsByKeys = await secretDAL.findBySecretKeys(
|
||||||
folder.id,
|
folder.id,
|
||||||
secrets.map((el) => ({
|
secretBatch.map((el) => ({
|
||||||
key: el.secretKey,
|
key: el.secretKey,
|
||||||
type: SecretType.Shared
|
type: SecretType.Shared
|
||||||
})),
|
})),
|
||||||
@@ -227,9 +229,6 @@ export const importDataIntoInfisicalFn = async ({
|
|||||||
message: `Secret already exist: ${secretsByKeys.map((el) => el.key).join(",")}`
|
message: `Secret already exist: ${secretsByKeys.map((el) => el.key).join(",")}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const secretBatches = chunkArray(secrets, 2500);
|
|
||||||
for await (const secretBatch of secretBatches) {
|
|
||||||
await fnSecretBulkInsert({
|
await fnSecretBulkInsert({
|
||||||
inputSecrets: secretBatch.map((el) => {
|
inputSecrets: secretBatch.map((el) => {
|
||||||
const references = getAllNestedSecretReferences(el.secretValue);
|
const references = getAllNestedSecretReferences(el.secretValue);
|
||||||
|
|||||||
Reference in New Issue
Block a user