misc: addressed issue

This commit is contained in:
Sheen Capadngan
2024-11-05 21:57:40 +08:00
parent be8562824d
commit cfa8770bdc
2 changed files with 8 additions and 7 deletions

View File

@@ -24,5 +24,5 @@ export type TSecretRotationDbFn = {
query: string;
variables: unknown[];
ca?: string;
options: Record<string, unknown>;
options?: Record<string, unknown>;
};

View File

@@ -94,7 +94,9 @@ export const secretRotationQueueFactory = ({
// on prod it this will be in days, in development this will be second
every: appCfg.NODE_ENV === "development" ? secondsToMillis(interval) : daysToMillisecond(interval),
immediately: true
}
},
removeOnComplete: true,
removeOnFail: true
}
);
};
@@ -173,14 +175,13 @@ export const secretRotationQueueFactory = ({
newCredential.internal.rotated_password = alphaNumericNanoId(32);
const { admin_username: username, admin_password: password, host, database, port, ca } = newCredential.inputs;
const options = (
const options =
provider.template.client === TDbProviderClients.MsSqlServer
? {
? ({
encrypt: true,
cryptoCredentialsDetails: ca ? { ca } : {}
}
: {}
) as Record<string, unknown>;
} as Record<string, unknown>)
: undefined;
const dbFunctionArg = {
username,