Skip to content

Commit

Permalink
fix: ajout de l'authsource pour airbyte (#3833)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Gaucher <[email protected]>
  • Loading branch information
Pomarom and Pomarom authored Sep 25, 2024
1 parent f14dc9b commit 973f852
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion server/src/common/mongodb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const ensureInitialization = (client: MongoClient | null): MongoClient => {
return client;
};

export const getMongodbUri = (dbName = config.mongodb.dbName) => {
export const getMongodbUri = (dbName: string = config.mongodb.dbName, withMainDbAuthent: boolean = false) => {
if (withMainDbAuthent) {
return `${config.mongodb.uri}${dbName}?${config.mongodb.options}&authSource=${config.mongodb.dbName}`;
}
return `${config.mongodb.uri}${dbName}?${config.mongodb.options}`;
};
/**
Expand Down
2 changes: 1 addition & 1 deletion server/src/jobs/hydrate/deca/hydrate-deca-raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { __dirname } from "@/common/utils/esmUtils";

const logger = parentLogger.child({ module: "job:hydrate:contrats-deca-raw" });

const client = new MongoClient(getMongodbUri("airbyte") ?? "");
const client = new MongoClient(getMongodbUri("airbyte", true));

export async function hydrateDecaRaw() {
let count = 0;
Expand Down

0 comments on commit 973f852

Please sign in to comment.