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