mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
Fix: Redundancies
This commit is contained in:
@@ -421,12 +421,9 @@ export const secretQueueFactory = ({
|
|||||||
|
|
||||||
const folder = await folderDAL.findBySecretPath(projectId, environment, secretPath);
|
const folder = await folderDAL.findBySecretPath(projectId, environment, secretPath);
|
||||||
if (!folder) {
|
if (!folder) {
|
||||||
logger.error(new Error("Secret path not found"));
|
throw new Error("Secret path not found");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// start syncing all linked imports also
|
|
||||||
if (depth < MAX_SYNC_SECRET_DEPTH) {
|
|
||||||
// find all imports made with the given environment and secret path
|
// find all imports made with the given environment and secret path
|
||||||
const linkSourceDto = {
|
const linkSourceDto = {
|
||||||
projectId,
|
projectId,
|
||||||
@@ -507,9 +504,6 @@ export const secretQueueFactory = ({
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
logger.info(`getIntegrationSecrets: Secret depth exceeded for [projectId=${projectId}] [folderId=${folder.id}]`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const integrations = await integrationDAL.findByProjectIdV2(projectId, environment); // note: returns array of integrations + integration auths in this environment
|
const integrations = await integrationDAL.findByProjectIdV2(projectId, environment); // note: returns array of integrations + integration auths in this environment
|
||||||
const toBeSyncedIntegrations = integrations.filter(
|
const toBeSyncedIntegrations = integrations.filter(
|
||||||
@@ -571,10 +565,12 @@ export const secretQueueFactory = ({
|
|||||||
syncMessage: "",
|
syncMessage: "",
|
||||||
isSynced: true
|
isSynced: true
|
||||||
});
|
});
|
||||||
} catch (err: unknown) {
|
} catch (err) {
|
||||||
logger.info("Secret integration sync error: %o", err);
|
logger.info("Secret integration sync error: %o", err);
|
||||||
|
|
||||||
const message =
|
const message =
|
||||||
err instanceof AxiosError ? JSON.stringify((err as AxiosError)?.response?.data) : (err as Error)?.message;
|
(err instanceof AxiosError ? JSON.stringify(err?.response?.data) : (err as Error)?.message) ||
|
||||||
|
"Unknown error occurred.";
|
||||||
|
|
||||||
await integrationDAL.updateById(integration.id, {
|
await integrationDAL.updateById(integration.id, {
|
||||||
lastSyncJobId: job.id,
|
lastSyncJobId: job.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user