misc: addressed comments

This commit is contained in:
Sheen Capadngan
2025-06-19 03:24:32 +08:00
parent f6e6bdb691
commit 41e65775ab
3 changed files with 39 additions and 31 deletions
+1 -1
View File
@@ -2393,7 +2393,7 @@ export const SecretSyncs = {
RENDER: {
serviceId: "The ID of the Render service to sync secrets to.",
scope: "The Render scope that secrets should be synced to.",
type: "The type of Render resource to sync secrets to."
type: "The Render resource type to sync secrets to."
},
FLYIO: {
appId: "The ID of the Fly.io app to sync secrets to."
@@ -90,11 +90,17 @@ const deleteEnvironmentSecret = async (secretSync: TRenderSyncWithCredentials, s
);
};
const sleep = async () =>
new Promise((resolve) => {
setTimeout(resolve, 500);
});
export const RenderSyncFns = {
syncSecrets: async (secretSync: TRenderSyncWithCredentials, secretMap: TSecretMap) => {
const renderSecrets = await getRenderEnvironmentSecrets(secretSync);
for await (const key of Object.keys(secretMap)) {
await putEnvironmentSecret(secretSync, secretMap, key);
await sleep();
}
if (secretSync.syncOptions.disableSecretDeletion) return;
@@ -106,6 +112,7 @@ export const RenderSyncFns = {
if (!secretMap[renderSecret.key]) {
await deleteEnvironmentSecret(secretSync, renderSecret);
await sleep();
}
}
},
@@ -120,6 +127,7 @@ export const RenderSyncFns = {
for await (const encryptedSecret of encryptedSecrets) {
if (encryptedSecret.key in secretMap) {
await deleteEnvironmentSecret(secretSync, encryptedSecret);
await sleep();
}
}
}