Skip to content

Commit

Permalink
start session using mongodb client
Browse files Browse the repository at this point in the history
mongoose startSession is throwing timeout errors
  • Loading branch information
daneryl committed Feb 11, 2025
1 parent fa455e0 commit db695ad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/api/odm/sessionsContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export const dbSessionContext = {

async startSession() {
const currentTenant = tenants.current();
const connection = DB.connectionForDB(currentTenant.dbName);
const session = await connection.startSession();
const session = DB.connectionForDB(currentTenant.dbName).getClient().startSession();
appContext.set('mongoSession', session);
return session;
},
Expand Down

0 comments on commit db695ad

Please sign in to comment.